Flask-Security is a Flask extension which adds basic security and authentication features to your Flask apps quickly and easily. It additionally bootstraps your application with various views for handling its configured features to get you up and running as quick as possible.
Questions tagged [flask-security]
319 questions
32
votes
4 answers
Testing Flask login and authentication?
I'm developing a Flask application and using Flask-security for user authentication (which in turn uses Flask-login underneath).
I have a route which requires authentication, /user. I'm trying to write a unit test which tests that, for an…

frnsys
- 2,404
- 3
- 21
- 25
29
votes
1 answer
Using Flask-Security Roles with Flask-JWT REST API
I am building a Flask-based REST API and using Flask-JWT to handle JWT auth. I also want to use the built in roles management with Flask-Security. However, Flask-Security's @roles_required() decorator assumes I am showing a Flask view when it…

chrcoe
- 412
- 4
- 13
23
votes
4 answers
How to secure the flask-admin panel with flask-security
I'm looking to secure Web API made using Flask and integrated with flask-admin to provide an admin interface. I searched and found that flask-admin has an admin panel at /admin and by default anyone can have access to it. It provides no…

Sanyam Khurana
- 1,336
- 1
- 14
- 27
19
votes
3 answers
How to use Flask-Security register view?
Has anyone used Flask-Security extension for authentication? How do I get register view to work?
http://packages.python.org/Flask-Security/customizing.html
I am referring to link above.
@app.route('/register', methods=['GET'])
def register():
…

Chirdeep Tomar
- 4,281
- 8
- 37
- 66
17
votes
3 answers
Token based authentication with flask-security extension
I am currently looking for a way to secure a REST API using token based authentication. I am developing the API in Python using Flask and have discovered the flask-security extension which seems to have a lot of interesting features.
One of the…

user2483431
- 783
- 2
- 7
- 11
14
votes
3 answers
Using OpenID/Keycloak with Superset
I want to use keycloak to authenticate my users in our Superset environment.
Superset is using flask-openid, as implemented in…

thijsfranck
- 778
- 1
- 10
- 24
13
votes
1 answer
How do you implement token authentication in Flask?
I'm trying to allow users to login to my Flask app using their accounts from a separate web service. I can contact the api of this web service and receive a security token. How do I use this token to authenticate users so that they have access to…

Amerikaner
- 131
- 1
- 1
- 7
12
votes
2 answers
How do I embed a Flask-Security login form on my page?
Using the example code provided by Flask-Security, I can access the login_user.html form from the /login route normally and that works just fine. However, I would like to embed the login form on all my site's pages in the upper left. I thought I…

Nicholas Tulach
- 1,023
- 3
- 12
- 35
12
votes
5 answers
How to get current user when implementing Python Flask-Security?
I am using Flask-Security to set up user authentication for my app but I am struggling with getting the email address or ID of the currently logged in user so I can query a table with that particular users details. I've just using the standard…

Johnny John Boy
- 3,009
- 5
- 26
- 50
12
votes
2 answers
Flask-Security user_registered Signal Not Received in Python 3.3, but works in 2.7
I'm trying to use the user_registered signal in order to set up default roles for users when they register using flask-security as in the following link: Setting Default Role in Flask Security
In my searches I can see that there was a bug that was…

khammel
- 2,047
- 1
- 14
- 18
12
votes
1 answer
Associate "external' class model with flask sqlalchemy
We use a central class model for a wide variety of python modules. This model is defined using SQLAlchemy. The classes all inherit from declarative_base.
For example, our model definitions look something like this:
Base = declarative_base()
class…

melchoir55
- 6,842
- 7
- 60
- 106
12
votes
2 answers
Proper way for user authentication with angularjs and flask
I'm currently working my way through Web development with flask. I want to build a webapp with flask as backend and angular.js at the frontend. The Json part is straight forward, and my first steps work out well. But now I got stuck with User…

bknux
- 536
- 1
- 5
- 18
12
votes
5 answers
Flask-Security CSRF token
I have a flask app that serves as REST API backend. I would like to implement token based authentication for the backend but in order to do that I need to retrieve the user token. Flask-Security documentation clearly says that to retrieve the token…

Jacopo
- 1,031
- 2
- 12
- 25
11
votes
2 answers
Importing a Flask-security instance into my views module breaks my webapp
I'm writing the sign up/sign in system for a ecommerce site, and using flask-security (http://pythonhosted.org/Flask-Security/) to handle the signup feature. Part of the basic setup requires the following signup.py module:
from flask.ext.security…

Faiyam Rahman
- 305
- 2
- 4
- 8
11
votes
2 answers
Flask-auth, Principal and Flask Security
Can anyone tell if there's a fundamental difference between these 3 extensions or do they all do similar things? I've been reading the docs and there seems to be quite a lot of crossover. I'm guessing some just offer more features.
I'm wanting to…

bobwal
- 522
- 6
- 19