Questions tagged [flask-security]

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.

319 questions
7
votes
2 answers

Using Flask-Security to authenticate REST API

I am using Flask-Security to build a web app that has a public REST API. I am trying to figure out how to add user registration and login using REST calls only. It is fairly easy to create a user using user_datastore.create_user. But how can I then…
emillamm
  • 139
  • 1
  • 6
6
votes
1 answer

Custom authentication method for Flask-Security

I'm using flask security to authenticate users. I've made sure the authentication works properly with the http_auth_required decorator - the user is being validated against the userstore (an SQLAlchemyUserDatastore in my case), and all is well. I…
mcouthon
  • 140
  • 7
6
votes
1 answer

Users appear to be logged in as another user

I'm using Flask-Security to manage users, and I'm getting reports that users are logged-in successfully as themselves, but randomly when they load a page, it will show them logged as someone completely different. I'm not sure where I'm going wrong.…
vik
  • 131
  • 1
  • 6
6
votes
1 answer

Explanation of the token-based password-reset functionality in Flask-Security

Can someone walk me through what's happening in flask-security's password reset token? The code is here on github: https://github.com/mattupstate/flask-security/blob/develop/flask_security/recoverable.py (There may be other parts up a…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
5
votes
1 answer

How to skip extra 'sign in with' page in Flask App Builder / Airflow

I have started using Apache Airflow (Built upon FAB) and enabled authentication through OAuth (as shown in FAB Security). I have ONLY one OAUTH_PROVIDER (azure). FYI, Airflow version 2.1.4 When I launch my airflow home page, it used to open the…
techrhl
  • 434
  • 8
  • 19
5
votes
1 answer

Flask Security- check what Roles a User has

I was looking at the flask-security api and i dont see any function that returns the list of roles a specific User has. Is there anyway to return a list of Roles a user has?
David Gonzalez
  • 135
  • 3
  • 14
5
votes
1 answer

Custom Form Flask Security Register

i am following the official documentation for flask-security customizing views https://pythonhosted.org/Flask-Security/customizing.html i have extented the Form class ExtendedRegisterForm(RegisterForm): first_name = StringField('First Name',…
stackedup
  • 63
  • 4
5
votes
1 answer

Hiding fields in Flask-Admin depending on logged in user?

I have Users and Roles in my Flask app thanks to Flask-Security. For some roles I would like to hide certain fields in the forms created by Flask-Admin. I know about customizing ModelViews with eg. form_create_rules = ('title', 'file') but while…
tiktuk
  • 485
  • 7
  • 19
5
votes
1 answer

Use Flask-Security to change password in code

I want to create a page to edit some user data, including the password. How can I change the password in my own view with Flask-Security?
Alexander
  • 833
  • 2
  • 8
  • 17
5
votes
2 answers

Flask-security and Bootstrap

How can I style my Flask-security login site with Bootstrap? The html form looks like this:
{{ login_user_form.hidden_tag() }} {{…
EspenG
  • 537
  • 3
  • 10
  • 20
5
votes
2 answers

flask-security: minimize the database hits

In my application, I have used flask-security to add authentication and authorization topics. SQLAlchemy is also used as the data provider (with MySQL as backend). The app is working fine. Then, I did some MySQL tracing, and the log shows me that at…
Miguel Prz
  • 13,718
  • 29
  • 42
5
votes
2 answers

(unittest) Testing Flask-Security: Cannot get past login page

I'm trying to add tests to my basic app. Accessing everything requires login. Here's my test case class: class MyAppTestCase(FlaskTestCaseMixin): def _create_app(self): raise NotImplementedError def _create_fixtures(self): …
Patrick Yan
  • 2,338
  • 5
  • 25
  • 33
5
votes
2 answers

Flask-security login and logout

How do you log a user in and out in Flask using the Flask-Security extension? I just started using flask-security, and going through the documentation here http://pythonhosted.org/Flask-Security/api.html , I can't really figure out how to explicitly…
rottentomato56
  • 1,059
  • 3
  • 13
  • 18
5
votes
1 answer

Implementing social login in Flask

Looking to implement social authentication in our application with LinkedIn, Google, Facebook. I'm currently using flask-security to help manage users/roles in our application. I'm looking for some guidance on best practices with…
taudep
  • 2,871
  • 5
  • 27
  • 36
4
votes
1 answer

flask-security + SQLAlchemy: can't reconnect until invalid transaction is rolled back

Edit: the environment: Python 3.8.3 Flask==1.1.2 Flask-Login==0.5.0 Flask-Security==3.0.0 SQLAlchemy==1.3.19 The database is MySQL 5.6.45, InnoDB tables. I'm new at flask-security and SQLAlchemy. I refer to the document of flask-security and try…
David Chung
  • 496
  • 5
  • 10
1 2
3
21 22