Flask-security: LDAP backend

Created on 22 Sep 2015  路  6Comments  路  Source: mattupstate/flask-security

Just a question : Would it be possible / suitable to implement a LDAP backend ?
So that Users can be configured as usual by other existing programs, and Flask-Security can just plug itself onto existing authentication mechanisms.

Most helpful comment

I've just hacked a code which addresses this feature. It basically consists of a custom login form and a custom Datastore, I'll try to document the code and make it Python2 compatible in order to send a pull request soon.

All 6 comments

Would highly appreciate this.

What would Flask-Security's value be in this case (as opposed to using Flask-Login and writing an integration with LDAP)?

@jonafato Currently I have a LDAP directory with a few hundred users and need a system that will allow them to login and do basic tasks as well as change their password via forgotten password email (off the email in LDAP for them,) or in their profile page. Role management and user registration integration would also be beneficial.

Flask security takes care of several of these tasks already.

For Django there is https://github.com/etianen/django-python3-ldap which would probably be a good working base but that would involve having to use django for the project instead of flask.

There's PWM https://github.com/pwm-project/pwm but I have been having difficulties getting it setup and working correctly as well as it lacking support for the group scheme I use (storing user DNs on the group instead of storing groups the user is a part of on the user.) Given It's in java and the documentation is out of date and mostly unhelpful has made it quite annoying to deal with given a large number of bugs/unexplained configuration details.

I don't believe LDAP integration in Flask-Security is a good idea. I'd rather not increase the scope of this project to include that feature.

@mattupstate Seeing as backends for other us storage units it would not be that large of an increase in scope, with most of the functionality probably achievable with a new storage class. I have been experimenting with it myself and it doesn't seem too difficult.

I've just hacked a code which addresses this feature. It basically consists of a custom login form and a custom Datastore, I'll try to document the code and make it Python2 compatible in order to send a pull request soon.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DerekDomino picture DerekDomino  路  5Comments

swedishmike picture swedishmike  路  5Comments

slippers picture slippers  路  4Comments

joeyespo picture joeyespo  路  3Comments

dappiu picture dappiu  路  8Comments