title: How to secure the flask-admin panel with flask-security
body: <p>I'm looking to secure Web API made using Flask and integrated with <code>flask-admin</code> to provide an admin interface. I searched and found that flask-admin has an admin panel at <code>/admin</code> and by default anyone can have access to it. It provides no authentication system and completely open (without any security) since they didn't assume what would be used to provide security. This API has to be used in production, so we can't have an open <code>/admin</code> route for everyone hitting the url. Proper authentication is needed.</p>
  
  <p>In <code>views.py</code> I can't simply put the <code>/admin</code> route and provide authentication through decorator as that would be over-writing the existing route already created by <code>flask-admin</code> so that would cause an error. </p>
  
  <p>Further research shows that there are two modules <code>flask-admin</code> and <code>flask-security</code>. I know that <code>flask-admin</code> has <code>is_accessible</code> method to secure it, but it doesn't provide much functionality which is provided by <code>flask-security</code>.</p>
  
  <p>I've not found any method there to secure the end-point <code>/admin</code> plus all other end-points beginning with <code>/admin</code> such as <code>/admin/&lt;something&gt;</code>.</p>
  
  <p>I'm looking specifically to do this task with flask-security. If it's not possible, please suggest alternatives.</p>
  
  <p>PS: I know I can lock <code>ngnix</code> itself, but that would be the last option. If I can have an authentication system through <code>flask-security</code> that would be good.</p>