jenkinsci / jenkinsci/active-directory-plugin
[JENKINS-46226] Wrong building of principalname and sAMAccountName
- Dominant language
- Java
- Stars
- 53
- Forks
- 115
- PR merge metrics
- No merged PRs in 30d
Description
The attributes UPN and sAMAccountName are independent.
UPN=a@b.c.d
and sAMAccountName=e are valid values for an user object in AD.
The method getPrincipalName is wrong when the user used the sAMAccountName in the login form and sAMAccountName is unequal from the first token before the @ in the UPN.
And this is the case if you follow the recommendations from Microsoft.
See here https://msdn.microsoft.com/en-us/library/ms680857(v=vs.85).aspx
This is just true for a special case and will fail in all other cases_
String samAccountName = userPrincipalName.substring(0, userPrincipalName.indexOf('@'));
---
Originally reported by grueni, imported from: Wrong building of principalname and sAMAccountName
fbelzunc
Raw content of original issue
The attributes UPN and sAMAccountName are independent.
UPN=a@b.c.dand sAMAccountName=e are valid values for an user object in AD.
The method getPrincipalName is wrong when the user used the sAMAccountName in the login form and sAMAccountName is unequal from the first token before the @ in the UPN.
And this is the case if you follow the recommendations from Microsoft.See here https://msdn.microsoft.com/en-us/library/ms680857(v=vs.85).aspx
This is just true for a special case and will fail in all other cases_
String samAccountName = userPrincipalName.substring(0, userPrincipalName.indexOf('@'));
- environment:
OpenIndiana hipster
Contributor guide
Research direction
Locate the getPrincipalName method in the active-directory-plugin and inspect how the login value is converted into a principal name and sAMAccountName. Reproduce the case where the sAMAccountName differs from the first token of the UPN, then verify that independent UPN and sAMAccountName values are handled correctly without breaking other login cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100