Skip to content

Commit

Permalink
Lowercase the Display ID (Provider Login)
Browse files Browse the repository at this point in the history
Based on behavior of the prior version and how data was provided in the older v1 tokens, force the provider login to lower case.

re: hkamel#144
  • Loading branch information
srvrguy committed Jan 5, 2023
1 parent ba272cf commit 12e0241
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/almrangers/auth/aad/AadUserInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ private void parseToken(JWT idToken) throws ParseException {
this.userOid = claims.getStringClaim("oid");
}

// Display ID
// Display ID (Used as the "Provider Login")
// Tries the "preferred username" first, and falls back to email
if(!"".equals(claims.getStringClaim(USERNAME_CLAIM)) && claims.getStringClaim(USERNAME_CLAIM) != null) {
this.displayId = claims.getStringClaim(USERNAME_CLAIM);
this.displayId = claims.getStringClaim(USERNAME_CLAIM).toLowerCase();
} else if(!claims.getStringClaim(EMAIL_CLAIM).isEmpty()) {
this.displayId = claims.getStringClaim(EMAIL_CLAIM);
this.displayId = claims.getStringClaim(EMAIL_CLAIM).toLowerCase();
}

// Display Name
Expand Down

0 comments on commit 12e0241

Please sign in to comment.