Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use of "personal" connections #12

Closed
extmind opened this issue Apr 11, 2015 · 1 comment
Closed

use of "personal" connections #12

extmind opened this issue Apr 11, 2015 · 1 comment
Assignees

Comments

@extmind
Copy link

extmind commented Apr 11, 2015

My use case is basically that a user logs into (using authenticate()) the app and changes his personal data (e.g. mail). The server is configured that you can query a user without binding using a password, so I do not need to store the admin password in a plain text file and a user binding with his own password may only ever change attributes he is entitled to.
But to change a users data, I would need his connection (as in authenticate()) instead of the general connection of the app (as configured in the plain text config). Given that, I think I would need to replace the original connection somehow and maybe even use the LDAPEntry object for flask-login (that also does not work, at least in the obvious way). Or am I missing something?

Is what I describe here possible to achieve with flask-ldapconn? If so, how?

@rroemhild rroemhild self-assigned this Apr 13, 2015
@rroemhild
Copy link
Owner

I think I finally found a good solution (352273f) for this. With Version 0.6.7 you can save a connection to the flask.g object and the connection handler will use this connection for the current request.

flask.g.ldap_conn = ldap.connect(binddn, secret)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants