spring-projects / spring-projects/spring-security

SEC-3096: Is it possible to make class ActiveDirectoryLdapAuthenticationProvider customizable?

Open
#3,303 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: ldap type: bug type: jira
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.