Class UserPrincipal
java.lang.Object
com.azure.spring.cloud.autoconfigure.aad.filter.UserPrincipal
- All Implemented Interfaces:
Serializable
entity class of UserPrincipal
- See Also:
-
Constructor Summary
ConstructorDescriptionUserPrincipal
(String aadIssuedBearerToken, com.nimbusds.jose.JWSObject jwsObject, com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet) Creates a new instance ofUserPrincipal
. -
Method Summary
Modifier and TypeMethodDescriptionGets the AAD issued bearer token.Gets the access token for Graph API.Gets a claim.Gets the claims.Gets the set of groups.Gets the issuer.getKeyId()
Gets the KID.getName()
Gets the name.getRoles()
Gets the set of roles.Gets the subject.gets the tenant ID.Gets the user principal name.boolean
isMemberOf
(AadAuthenticationProperties aadAuthenticationProperties, String group) Whether the group is a member of the user principal.boolean
Whether the user principal is a personal account.void
setAccessTokenForGraphApi
(String accessTokenForGraphApi) Sets the access token for Graph API.void
Sets the set of groups.void
Sets the set of roles.
-
Constructor Details
-
UserPrincipal
public UserPrincipal(String aadIssuedBearerToken, com.nimbusds.jose.JWSObject jwsObject, com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet) Creates a new instance ofUserPrincipal
.- Parameters:
aadIssuedBearerToken
- the AAD issued bearer tokenjwsObject
- the JWS objectjwtClaimsSet
- the JWT claims set
-
-
Method Details
-
getAadIssuedBearerToken
Gets the AAD issued bearer token.- Returns:
- the AAD issued bearer token
-
getGroups
Gets the set of groups.- Returns:
- the set of groups
-
setGroups
Sets the set of groups.- Parameters:
groups
- the set of groups
-
getRoles
Gets the set of roles.- Returns:
- the set of roles
-
setRoles
Sets the set of roles.- Parameters:
roles
- the set of roles
-
getAccessTokenForGraphApi
Gets the access token for Graph API.- Returns:
- the access token for Graph API
-
setAccessTokenForGraphApi
Sets the access token for Graph API.- Parameters:
accessTokenForGraphApi
- the access token for Graph API
-
isMemberOf
Whether the group is a member of the user principal.- Parameters:
aadAuthenticationProperties
- the AAD authentication propertiesgroup
- the group- Returns:
- whether the group is a member of the user principal
-
getKeyId
Gets the KID.- Returns:
- the KID
-
getIssuer
Gets the issuer.- Returns:
- the issuer
-
getSubject
Gets the subject.- Returns:
- the subject
-
getClaims
Gets the claims.- Returns:
- the claims
-
getClaim
Gets a claim.- Parameters:
name
- the claim name- Returns:
- a claim
-
getName
Gets the name.- Returns:
- the name
-
getTenantId
gets the tenant ID.- Returns:
- the tenant ID
-
getUserPrincipalName
Gets the user principal name.- Returns:
- the user principal name
-
isPersonalAccount
public boolean isPersonalAccount()Whether the user principal is a personal account.- Returns:
- whether the user principal is a personal account
-