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
3
votes
1 answer

Flask-security create role,user and linking user_id to role_id

I using Flask-Security with SQLAlchemy When want to add user or role def addrole(): form=addroll() createRole=user_datastore.create_role(name=form.role.data,description=form.description.data) db.session.add(createRole) …
3
votes
1 answer

Unhashable Type error when modifying SqlAlchemy Models

I am using the most basic flask app practically copied from documentations, and am receiving an extremely annoying error. I've been able to trace it down but don't know how to solve it. I know the problem arises when implementing flask-security,…
tryexceptcontinue
  • 1,587
  • 15
  • 13
3
votes
2 answers

flask-security ajax logout causes session errors

When I post to a flask endpoint: @app.route('/api/v1/logout', methods=['POST','GET']) def logout(): logout_user() return jsonify(status=200, message='User has been successfully logged out.') I get an error when I try to log in the next…
user784756
  • 2,363
  • 4
  • 28
  • 44
2
votes
0 answers

not able to logout of airflow 2.1.1 after integrating with keycloak(OAUTH2)

I have installed airflow2.1.1 on centos7 VM. I have integrated with keycloak using OAUTH provider configuration. I am able to login but not able to logout. Its throwing "access is denied" error on UI. Please find below OAUTH config properties from…
2
votes
3 answers

Flask-Security Custom email validator

I've set up Flask-Security and I'm trying to an e-mail to be validated against lists in a database. I want to keep the current email validators and add a new one. Below is the code that I'm adding to extend the registration form. But I'm not getting…
2
votes
1 answer

How can I validate a hash generated by Flask-Security without using it?

I have a Flask application running that has Flask-Security on it. My config.py file looks like this: ... # Flask-Security config SECURITY_URL_PREFIX = "..." # my URL prefix SECURITY_PASSWORD_HASH = "pbkdf2_sha512" SECURITY_PASSWORD_SALT = "..." #…
Gabriel Milan
  • 702
  • 2
  • 7
  • 21
2
votes
2 answers

How to make Flask-Security login via email or another field?

I am now using Flask-Security to make a login page for my website. However, it can only login via email. I want it to login via both email and cellphone number. I have followed the instructions from this post: flask-security login via username and…
2
votes
1 answer

Unable to use forgot password in Flask-Security

I have an app using flask security for login. My settings are: SECURITY_PASSWORD_SALT = 'hjdsafjkhalkj' SECURITY_PASSWORD_HASH='bcrypt' SECURITY_RECOVERABLE=True SECURITY_CHANGEABLE=True SECURITY_EMAIL_SENDER = os.environ['COMPLIANCE'] Here is how…
jesseCampeez
  • 97
  • 10
2
votes
1 answer

Trouble extending Flask-Security login template

I'm using Flask-Security in my project and I would like to extend templates (namely login) it offers, in order to style them with custom CSS. Following the documentation, I've changed the SECURITY_LOGIN_USER_TEMPLATE config value to point to my…
heky__
  • 85
  • 2
  • 6
2
votes
1 answer

What is the equivalent of SENTRY_USER_ATTRS in the new SDK sentry-sdk/sentry-python?

How do you configure the user data sent when using send_default_pii=True with flask-login for the Sentry Unified Python SDK? The docs say: If you use flask-login and have set send_default_pii=True in your call to init, user data (current user id,…
craigmichaelmartin
  • 6,091
  • 1
  • 21
  • 25
2
votes
1 answer

Flask Security Confirm Register Form not adding new fields

Below is how I am trying to add extra fields to the confirm register form. When I enter my credentials in my application the application takes all the built in fields, sends it to my data base, and sends me a working confirmation email. However, the…
LoganHenderson
  • 1,222
  • 4
  • 12
  • 24
2
votes
0 answers

Flask-Security register user while already logged in as admin

So I've got a simple web app which allows the admin to create accounts for users (this procedure is necessary like this). Therefore, I have a user management page where the admin account is able to add new users to the system. I've managed to add…
2
votes
2 answers

SECURITY_UNAUTHORIZED_VIEW did not redirect to login page

I am using flask security for authentication what i want is when user access to a specific url without login/access then it redirects to login page but it redirects to home page. I know if i add @login_required decorator then it will redirect to…
Hassan Shahbaz
  • 596
  • 1
  • 14
  • 38
2
votes
3 answers

flask-security add_role_to_user does not accept username

when attempting to assign a role to a user, what is the trick to make it work with the username instead of the email? The following works: user_datastore.add_role_to_user('nunya@beezwax.com', 'site-admin') this does not work:…
Simply Seth
  • 3,246
  • 17
  • 51
  • 77
2
votes
1 answer

how can I pass curent_user from flask-security to a pluggable view function?

I have a flask app that uses flask security for authentication. I want to use graphql with graphene to fetch data but I'm having trouble accessing the current_user proxy which is I've always used to resolve requests. graphene only provides a…