spring-projects / spring-projects/spring-security
SEC-3096: Is it possible to make class ActiveDirectoryLdapAuthenticationProvider customizable?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Arnošt Havelka (Migrated from SEC-3096) said:
Well we are using Active Directory authentication. I'm not sure what's the reason, but our AD has not sAMAccountName as "user@my.domain.com", but only as "user".
Our current solution is to copy&paste class ActiveDirectoryLdapAuthenticationProvider and modify method searchForUser to call SpringSecurityLdapTemplate.searchForSingleEntryInternal(...) with username instead of bindPrincipal. This solution works, but it's really nasty :-).
Since this class is final and not Spring bean than I have no option (not found any yet) to customize it (to suite it to our AD).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading ActiveDirectoryLdapAuthenticationProvider and its searchForUser method, then inspect SpringSecurityLdapTemplate.searchForSingleEntryInternal as referenced in the report. Determine how the provider could support the reported username lookup without requiring a copied class. Done means the provider can be customized for Active Directory setups where sAMAccountName contains only the username.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100