Skip to content

Commit

Permalink
- add function to get jwtclaim value directly(Azure#17166)
Browse files Browse the repository at this point in the history
Add function to get jwtclaim value directly
  • Loading branch information
backwind1233 authored Nov 5, 2020
1 parent 1b0f502 commit 8cf8a4b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,13 @@ public Map<String, Object> getClaims() {
public Object getClaim(String name) {
return jwtClaimsSet == null ? null : jwtClaimsSet.getClaim(name);
}

public String getName() {
return jwtClaimsSet == null ? null : (String) jwtClaimsSet.getClaim("name");
}

public String getUserPrincipalName() {
return jwtClaimsSet == null ? null : (String) jwtClaimsSet.getClaim("preferred_username");
}
}

0 comments on commit 8cf8a4b

Please sign in to comment.