Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Security] fixes LDAP bind authentication using wrong username#21588

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@haffmans
Copy link

QA
Branch?3.2
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT

I'm trying to set up LDAP authentication where users can log in using their e-mail address, which should get resolved to the 'uid' field in the directory. After this the authentication should be based on this uid. I'm working against '389 directory server' as set up by a Kolab install. This does not seem to allow binding based on e.g. the mail field of a user.

The LDAP user provider is able to resolve the user. This is the (redacted) provider config I'm using:

    providers:        kolab:            ldap:                service: ldap                base_dn: 'ou=People,dc=example,dc=com'                search_dn: "%ldap_search_dn%"                search_password: "%ldap_search_password%"                default_roles: ROLE_ADMIN                uid_key: uid                filter: '(&(|(objectclass=inetorgperson))(|(mailPrimaryAddress={username})(mail={username})))'

I noticed the User object created by the LdapUserProvider is correctly set the the uid field of the user.

However, the LDAP Bind Authentication Provider does not use the username as provided by the user provider. Instead it uses the username as submitted in the token when binding. This means users cannot login.

The fix is to use$user->getUsername() instead of$token->getUsername() incheckAuthentication(). This way the resolved username is used and the authentication works correctly.

This fixes that the LDAP bind authentication ignores the uid_keyconfiguration of the LDAP user provider. It will now use the username ofthe User object instead of the token's username.
@nicolas-grekas
Copy link
Member

ping@csarrazi

@nicolas-grekasnicolas-grekas added this to the3.2 milestoneFeb 18, 2017
@fabpot
Copy link
Member

@csarrazi Can you have a look at this PR? Thanks.

@csarrazi
Copy link
Contributor

This has already been fixed in themaster branch by#21402

Also, the reason why we use the token's username is because we should not rely on the user provider to provide the username. This works fine when you are using the LDAP user provider, but it may fail should you use another user provider.

E.g. If you want to authenticate using your LDAP server, but rely on the database to store user-related information.

@fabpot
Copy link
Member

@csarrazi Thanks for the quick feedback. So, can we close this one then?

@csarrazi
Copy link
Contributor

Yes, we can close it.

@haffmans, can you check whether your problem is fixed with@lsmith77's fix (by using the master branch)? Thanks

@fabpotfabpot closed thisMar 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

3.2

Development

Successfully merging this pull request may close these issues.

5 participants

@haffmans@nicolas-grekas@fabpot@csarrazi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp