Enable domain-less sAMAccountName in LdapAdapter
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
The [LdapAdapter class](https://github.com/dotnet/aspnetcore/blob/main/src/Security/Authentication/Negotiate/src/Internal/LdapAdapter.cs) is using the full down-level logon name to do LDAP queries.
In our active directory the sAMAccountName doesn't contain the domain and hence the lookup fails.
I found definitions which say [it's a must to contain the domain name](https://serverfault.com/questions/779504/samaccountname-requires-domain-to-authenticate) and [vice versa](https://learn.microsoft.com/en-us/windows/win32/adschema/a-samaccountname)
### Describe the solution you'd like
Would it be possible to introduce an option to change the behavior of LdapAdapter to omit the domain name on the ldap lookup?
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.