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]
282 questions
28
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…
![](../../users/profiles/740453.webp)
chrcoe
- 392
- 3
- 13
27
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…
![](../../users/profiles/1097920.webp)
frnsys
- 2,014
- 2
- 19
- 23
22
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…
![](../../users/profiles/3535547.webp)
Sanyam Khurana
- 766
- 1
- 8
- 21
18
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():
…
![](../../users/profiles/887976.webp)
Chirdeep Tomar
- 3,513
- 5
- 29
- 60
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…
![](../../users/profiles/2483431.webp)
user2483431
- 673
- 1
- 7
- 10
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…
![](../../users/profiles/5322740.webp)
Amerikaner
- 131
- 1
- 1
- 7
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…
![](../../users/profiles/5029279.webp)
khammel
- 1,809
- 1
- 9
- 16
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…
![](../../users/profiles/2047460.webp)
bknux
- 516
- 1
- 5
- 17
11
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…
![](../../users/profiles/3933805.webp)
Nicholas Tulach
- 713
- 1
- 7
- 23
11
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…
![](../../users/profiles/1812993.webp)
melchoir55
- 5,131
- 1
- 46
- 87
11
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…
![](../../users/profiles/732886.webp)
Jacopo
- 981
- 1
- 11
- 24
10
votes
2 answers
Combining Flask-restless, Flask-security and regular Python requests
My goal is to provide a REST API to my web application. Using:
Python 2.7.5
Flask==0.10.1
Flask-Restless==0.13.1
Flask-Security==1.7.3
I need to secure access to my data for both web and REST access. However, I am unable to get any regular python…
![](../../users/profiles/2069099.webp)
Nic
- 2,714
- 2
- 17
- 30
10
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…
![](../../users/profiles/2154649.webp)
Faiyam Rahman
- 245
- 1
- 4
- 8
10
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…
![](../../users/profiles/2382411.webp)
bobwal
- 384
- 4
- 15
9
votes
1 answer
flask-security: how to use in blueprint/extension app pattern?
I want to use flask-security.
I'm using a template flask app which creates global objects for extensions, and then initialises them when the app is created.
e.g. in extensions.py there is code like this:
from flask_bcrypt import Bcrypt
from…
![](../../users/profiles/401226.webp)
Tim Richardson
- 4,127
- 5
- 32
- 59