Skip to content

Allow using username in Active Directory LDAP search filter #3950

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

Closed
wants to merge 1 commit into from

Conversation

zhoppy1
Copy link

@zhoppy1 zhoppy1 commented Jun 28, 2016

When customizing the LDAP search filter used by ActiveDirectoryLdapAuthenticationProvider I have a need to reference just the username. The default {0} is username@domain. This small change will allow filters to reference the username with {1}

Example:

userPrincipalName = [email protected]
sAMAccountName = someUser
Domain Name: foo

Trying to set the filter to use sAMAccountName instead of userPrincipalName results in the domain name being included.

provider.setSearchFilter("(&(objectClass=user)(sAMAccountName={0}))");

Results in (&(objectClass=user)([email protected]))

This code change will let me use {1} in the filter instead so the search will be: (&(objectClass=user)(sAMAccountName=someUser))

I was unable to simply extend ActiveDirectoryLdapAuthenticationProvider because it is marked final.

@pivotal-issuemaster
Copy link

@zhoppy1 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@jgrandja
Copy link
Contributor

Related to #249

@jgrandja
Copy link
Contributor

Thanks for submitting this PR @zhoppy1.

We are currently re-thinking our approach to an Active Directory AuthenticationProvider implementation. Our direction is to deprecate ActiveDirectoryLdapAuthenticationProvider and leverage the existing LdapAuthenticationProvider and provide a custom strategy of LdapAuthenticator for Active Directory.

The work has already started in #4064 if you would like to track the progress and provide any input/feedback.

I'm going to close this PR as we will address your input/feedback in #4064.
Thank you.

@jgrandja jgrandja closed this Sep 19, 2016
@jgrandja jgrandja removed this from the 4.2.0 M1 milestone Sep 19, 2016
@jgrandja jgrandja added the status: declined A suggestion or change that we don't feel we should currently apply label Sep 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants