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
2
votes
2 answers

flask admin: How to make a query according to the current user's id and role?

I used the classes below, allowing users to edit their own profile after registering and it works well. I achieve this using get_query and get_count_query. However, if the current user is administrator, how can I customize it to let him/her view…
Samoth
  • 716
  • 15
  • 34
2
votes
2 answers

User Registration - Flask Security

Have been following Flask Security protocols for user registration and login form for flask blog-post type app, using ORM peewee. Login works like a charm though registration is posing issue. Related Question How to use Flask-Security register…
Manganese
  • 650
  • 5
  • 26
2
votes
3 answers

Flask + Flask-Security + Babel not working

I have setup with Flask + Babel + Flask Security. Created all translation like this: root main.py translations ru LC_MESSAGES messages.mo messages.po In main.py there is part to setup language which executes: @babel.localeselector def…
andjelx
  • 199
  • 1
  • 13
2
votes
3 answers

flask-security can't work with gunicorn with multiple workers?

I'm writing a website with Flask. I use Flask-Secuirty to do authentication. I use nginx + gunicorn to deploy it. The configuration of nginx as follow: server{ listen 80; server_name project.example.com; location / { proxy_pass…
stamaimer
  • 6,227
  • 5
  • 34
  • 55
2
votes
1 answer

DataError: (psycopg2.DataError) invalid input syntax for integer: "https://api.stormpath.com/v1/accounts/xxxxxxxxxxxxxxxxxxx"

I was using Flask-Stormpath and then I switched to Flask-security instead of Flask-Stormpath. So I uninstall it(stormpath). But somehow I don't know it is taking stormpath account to find user detail. DataError: (psycopg2.DataError) invalid input…
Bhargav Patel
  • 151
  • 2
  • 10
2
votes
0 answers

flask-security crash on itsdangerous

I'm pretty sure it is me and not a bug - but assitance in figuring it out would be appreciated I'm getting a crash in itsdangerous def derive_key(self): """This method is called to derive the key. If you're unhappy with the…
Boaz
  • 4,864
  • 12
  • 50
  • 90
2
votes
2 answers

How to customize flask.ext.security.forms.LoginForm to prompt and use username instead of email?

How to customize flask.ext.security.forms.LoginForm to prompt and use username instead of email? I have tried this, class ExtendedLoginForm(LoginForm): name = TextField('User Name:', [Required()]) del LoginForm.email security =…
Raja R
  • 39
  • 1
  • 3
2
votes
1 answer

"TypeError: hashpw() argument 1 must be str, not bytes" when trying to register a user with flask-security

I'm trying to create a small flask application using the Enferno framework, but when I try to register a user I get an error that seems to be generated by the passlib library. I can't understand if it's something I did or if it is an error in the…
El3k0n
  • 51
  • 1
  • 4
2
votes
0 answers

How do I implement granular ACLs at the template level with Jinja2 and Flask?

How do I implement granular ACLs at the template level with Jinja2 and Flask? Here is what I have without a Jinja2 context dictionary or any prebuilt Flask ACL library. This is my own psuedo ACL where I simply would query a database for a role and…
johnny
  • 19,272
  • 52
  • 157
  • 259
2
votes
1 answer

Invalid Confirmation Token when trying to confirm user email manually with Flask-Security

Trying to figure out what is different between when I call send_confirmation_instructions and when it gets called with the built-in resend confirmation instructions form. Here's the call in my new user view: newuser = User( email =…
Chockomonkey
  • 3,895
  • 7
  • 38
  • 55
2
votes
1 answer

Sending async email with Flask-Security

I'm attempting to configure Flask-Security to send email asynchronously. I have some code which send async email via Flask-Mail, but I'm having trouble integrating it with my application factory function so that it works in conjunction with…
Josh
  • 662
  • 11
  • 27
2
votes
0 answers

What runs activate_user() in Flask-Security

I took a look into the code of Flask-Security and can't figure out what runs datastore.activate_user() so the current_user.is_active returns True ? from flask.ext.security.utils import login_user class LoginView(BaseView): methods = ['GET',…
mastier
  • 872
  • 1
  • 10
  • 22
2
votes
1 answer

Flask-Security: how to set up the database outside the main py file?

I'm using Flask-Security 1.7.4 together with Flask 0.10.1. I have no problem running my website if the database scheme is stored in the python file app.py: from flask.ext.security import RoleMixin, UserMixin, SQLAlchemyUserDatastore, Security from…
Julien
  • 231
  • 4
  • 18
2
votes
2 answers

Using Flask-Security as part of a REST API

The Flask-Security docs mention JSON/Ajax support for all of the important view endpoints. So it's possible to get all of the buit-in Flask-Security awesomeness by hitting the views with JSON objects. But, now I'm trying to use it as part of a…
petrus-jvrensburg
  • 1,353
  • 15
  • 19
2
votes
1 answer

Flask-Security access Login Manager

I'm working to develop a flask application. I've settled on using Flask-Security for a lot of the great features it has. However I'm having a hard time finding examples of working code beyond the QuickStart they give here. Specifically, I need to…
user3666149
  • 133
  • 2
  • 9