java.lang.Object
com.azure.spring.cloud.autoconfigure.aad.filter.UserPrincipal
All Implemented Interfaces:
Serializable

public class UserPrincipal extends Object implements Serializable
entity class of UserPrincipal
See Also:
  • Constructor Details

    • UserPrincipal

      public UserPrincipal(String aadIssuedBearerToken, com.nimbusds.jose.JWSObject jwsObject, com.nimbusds.jwt.JWTClaimsSet jwtClaimsSet)
      Creates a new instance of UserPrincipal.
      Parameters:
      aadIssuedBearerToken - the AAD issued bearer token
      jwsObject - the JWS object
      jwtClaimsSet - the JWT claims set
  • Method Details

    • getAadIssuedBearerToken

      public String getAadIssuedBearerToken()
      Gets the AAD issued bearer token.
      Returns:
      the AAD issued bearer token
    • getGroups

      public Set<String> getGroups()
      Gets the set of groups.
      Returns:
      the set of groups
    • setGroups

      public void setGroups(Set<String> groups)
      Sets the set of groups.
      Parameters:
      groups - the set of groups
    • getRoles

      public Set<String> getRoles()
      Gets the set of roles.
      Returns:
      the set of roles
    • setRoles

      public void setRoles(Set<String> roles)
      Sets the set of roles.
      Parameters:
      roles - the set of roles
    • getAccessTokenForGraphApi

      public String getAccessTokenForGraphApi()
      Gets the access token for Graph API.
      Returns:
      the access token for Graph API
    • setAccessTokenForGraphApi

      public void setAccessTokenForGraphApi(String accessTokenForGraphApi)
      Sets the access token for Graph API.
      Parameters:
      accessTokenForGraphApi - the access token for Graph API
    • isMemberOf

      public boolean isMemberOf(AadAuthenticationProperties aadAuthenticationProperties, String group)
      Whether the group is a member of the user principal.
      Parameters:
      aadAuthenticationProperties - the AAD authentication properties
      group - the group
      Returns:
      whether the group is a member of the user principal
    • getKeyId

      public String getKeyId()
      Gets the KID.
      Returns:
      the KID
    • getIssuer

      public String getIssuer()
      Gets the issuer.
      Returns:
      the issuer
    • getSubject

      public String getSubject()
      Gets the subject.
      Returns:
      the subject
    • getClaims

      public Map<String,Object> getClaims()
      Gets the claims.
      Returns:
      the claims
    • getClaim

      public Object getClaim(String name)
      Gets a claim.
      Parameters:
      name - the claim name
      Returns:
      a claim
    • getName

      public String getName()
      Gets the name.
      Returns:
      the name
    • getTenantId

      public String getTenantId()
      gets the tenant ID.
      Returns:
      the tenant ID
    • getUserPrincipalName

      public String 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