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

LDAP users are keyed against the wrong username. #133

Open
NickH-nz opened this issue Oct 27, 2020 · 1 comment
Open

LDAP users are keyed against the wrong username. #133

NickH-nz opened this issue Oct 27, 2020 · 1 comment

Comments

@NickH-nz
Copy link

Issue Type
  • Bug Report
  • Feature enhancement
Summary

When using the LDAP authentication plugin, users are keyed against the wrong username.

Basic environment details

GoCD Version: 20.7.0 (12097-f4f86ca8d433edaf9235ed92790c11e19d7be4ed).
LDAP Plugin: LDAP Authentication Plugin for GoCD v2.0.1-90 (bundled)

Steps to Reproduce
  1. Setup LDAP plugin to accept both mail or uid (|(uid={0})(mail={0})) connected to a directory at example.com.
  2. Login with email ([email protected])
  3. Logout
  4. Login with uid (nick)
  5. Notice that two users have been created
Expected Results

I would expect users to be created with a username equal to their uid attribute.
Specifying either mail or uid (or any combination supported by the user filter) at login would log you into the same user.

Actual Results

Users are created with usernames equal to the value entered into the username field at login.
A user is created for each variant supplied in the login field, even if mapped to the same LDAP user.

Possible Fix
  • Use the LDAP uid attribute to key users, rather than the user-supplied value.
  • Alternatively, supply a config option on the plugin to specify how the username field should be filled.
@maheshp
Copy link
Contributor

maheshp commented Oct 27, 2020

You are right, on successful authentication the plugin returns a user with the username same as that in the credentials.
The GoCD LDAP Authorization Plugin has an options to specify the UserNameAttributein the Authorization Configuration, maybe consider using it.

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