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

How to bind with user credentials from session #35

Open
jkroepke opened this issue Nov 3, 2017 · 1 comment
Open

How to bind with user credentials from session #35

jkroepke opened this issue Nov 3, 2017 · 1 comment

Comments

@jkroepke
Copy link

jkroepke commented Nov 3, 2017

See: #17

Hi,

currently i'm building something like an LDAP UI.

Instead a hardcoded bind user, I want to use the credentials from the user login.

Since since works on the login fine, I want to use the credentials from the user for the whole session.

Any ideas, how to save (encrypted?) the credentials in the session and reuse them for the user bind?

Why?

For example: It impossible that a (non admin) can modify other objects then itself.

@jkroepke jkroepke changed the title How to bind with user credentials from login How to bind with user credentials from session Nov 3, 2017
@ChadSikorra
Copy link
Contributor

You're on the right track. The way I've done this is to hook into the Symfony request start event (forget exactly what it is called at the moment), and if the user is authenticated then you can modify the config of the LdapManger class and do setUsername() and setPassword(). For that to work you need to encrypt the password as a session variable anyway, then decrypt and use it in the previous step. Then when the connection actually is used it will utilize those credentials on the bind.

I can pull up the code sometime this week to give a more concrete example since I'm doing this exact thing in a project. Apologies for the late response by the way.

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