java.lang.Object
io.micronaut.security.oauth2.endpoint.token.response.JWTOpenIdClaims
All Implemented Interfaces:
OpenIdClaims, Claims

public class JWTOpenIdClaims extends Object implements OpenIdClaims
An implementation of OpenIdClaims backed by an JWTClaimsSet.
Since:
1.2.0
Author:
James Kleeh
  • Constructor Details

    • JWTOpenIdClaims

      public JWTOpenIdClaims(com.nimbusds.jwt.JWTClaimsSet claimsSet)
      Parameters:
      claimsSet - The JWT claims set
  • Method Details

    • getIssuer

      @NonNull public @NonNull String getIssuer()
      Specified by:
      getIssuer in interface OpenIdClaims
      Returns:
      Subject Identifier. A locally unique and never reassigned identifier within the Issuer for the End-User, which is intended to be consumed by the Client,
    • getAudience

      @NonNull public @NonNull List<String> getAudience()
      Specified by:
      getAudience in interface OpenIdClaims
      Returns:
      Audience(s) that this ID Token is intended for.
    • getExpirationTime

      @NonNull public @NonNull Date getExpirationTime()
      Specified by:
      getExpirationTime in interface OpenIdClaims
      Returns:
      Expiration time on or after which the ID Token MUST NOT be accepted for processing.
    • getIssuedAt

      @NonNull public @NonNull Date getIssuedAt()
      Specified by:
      getIssuedAt in interface OpenIdClaims
      Returns:
      Time at which the JWT was issued.
    • getSubject

      @NonNull public @NonNull String getSubject()
      Description copied from interface: OpenIdClaims
      sub.
      Specified by:
      getSubject in interface OpenIdClaims
      Returns:
      Identifier for the End-User at the Issuer.
    • getAuthorizedParty

      @Nullable public @Nullable String getAuthorizedParty()
      Specified by:
      getAuthorizedParty in interface OpenIdClaims
      Returns:
      The party to which the ID Token was issued.
    • getAuthenticationMethodReferences

      @Nullable public @Nullable List<String> getAuthenticationMethodReferences()
      Specified by:
      getAuthenticationMethodReferences in interface OpenIdClaims
      Returns:
      Identifiers for authentication methods used in the authentication.
    • getAuthenticationContextClassReference

      @Nullable public @Nullable String getAuthenticationContextClassReference()
      Specified by:
      getAuthenticationContextClassReference in interface OpenIdClaims
      Returns:
      Authentication Context Class Reference.
    • getAuthenticationTime

      @Nullable public @Nullable Integer getAuthenticationTime()
      Specified by:
      getAuthenticationTime in interface OpenIdClaims
      Returns:
      Time when the End-User authentication occurred.
    • getNonce

      @Nullable public @Nullable String getNonce()
      Specified by:
      getNonce in interface OpenIdClaims
      Returns:
      String value used to associate a Client session with an ID Token, and to mitigate replay attacks.
    • getName

      @Nullable public @Nullable String getName()
      Description copied from interface: OpenIdClaims
      name.
      Specified by:
      getName in interface OpenIdClaims
      Returns:
      End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences.
    • getGivenName

      @Nullable public @Nullable String getGivenName()
      Description copied from interface: OpenIdClaims
      given_name.
      Specified by:
      getGivenName in interface OpenIdClaims
      Returns:
      Given name(s) or first name(s) of the End-User. Note that in some cultures, people can have multiple given names; all can be present, with the names being separated by space characters.
    • getFamilyName

      @Nullable public @Nullable String getFamilyName()
      Description copied from interface: OpenIdClaims
      family_name.
      Specified by:
      getFamilyName in interface OpenIdClaims
      Returns:
      Surname(s) or last name(s) of the End-User. Note that in some cultures, people can have multiple family names or no family name; all can be present, with the names being separated by space characters.
    • getMiddleName

      @Nullable public @Nullable String getMiddleName()
      Description copied from interface: OpenIdClaims
      middle_name.
      Specified by:
      getMiddleName in interface OpenIdClaims
      Returns:
      Middle name(s) of the End-User. Note that in some cultures, people can have multiple middle names; all can be present, with the names being separated by space characters. Also note that in some cultures, middle names are not used.
    • getNickname

      @Nullable public @Nullable String getNickname()
      Description copied from interface: OpenIdClaims
      nickname.
      Specified by:
      getNickname in interface OpenIdClaims
      Returns:
      Casual name of the End-User that may or may not be the same as the given_name. For instance, a nickname value of Mike might be returned alongside a given_name value of Michael.
    • getPreferredUsername

      @Nullable public @Nullable String getPreferredUsername()
      Description copied from interface: OpenIdClaims
      preferred_username.
      Specified by:
      getPreferredUsername in interface OpenIdClaims
      Returns:
      Shorthand name by which the End-User wishes to be referred to at the RP, such as janedoe or j.doe. This value MAY be any valid JSON string including special characters such as @, /, or whitespace. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7.
    • getProfile

      @Nullable public @Nullable String getProfile()
      Specified by:
      getProfile in interface OpenIdClaims
      Returns:
      URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User.
    • getPicture

      @Nullable public @Nullable String getPicture()
      Specified by:
      getPicture in interface OpenIdClaims
      Returns:
      URL of the End-User's profile picture. This URL MUST refer to an image file (for example, a PNG, JPEG, or GIF image file), rather than to a Web page containing an image. Note that this URL SHOULD specifically reference a profile photo of the End-User suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User.
    • getWebsite

      @Nullable public @Nullable String getWebsite()
      Specified by:
      getWebsite in interface OpenIdClaims
      Returns:
      URL of the End-User's Web page or blog. This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with.
    • getEmail

      @Nullable public @Nullable String getEmail()
      Specified by:
      getEmail in interface OpenIdClaims
      Returns:
      End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The RP MUST NOT rely upon this value being unique, as discussed in Section 5.7.
    • isEmailVerified

      @Nullable public @Nullable Boolean isEmailVerified()
      Specified by:
      isEmailVerified in interface OpenIdClaims
      Returns:
      True if the End-User's e-mail address has been verified; otherwise false.
    • getGender

      @Nullable public @Nullable String getGender()
      Specified by:
      getGender in interface OpenIdClaims
      Returns:
      End-User's gender. Values defined by this specification are female and male. Other values MAY be used when neither of the defined values are applicable.
    • getBirthday

      @Nullable public @Nullable String getBirthday()
      Specified by:
      getBirthday in interface OpenIdClaims
      Returns:
      End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.
    • getZoneinfo

      @Nullable public @Nullable String getZoneinfo()
      Description copied from interface: OpenIdClaims
      zoneinfo.
      Specified by:
      getZoneinfo in interface OpenIdClaims
      Returns:
      String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone. For example, Europe/Paris or America/Los_Angeles.
    • getLocale

      @Nullable public @Nullable String getLocale()
      Specified by:
      getLocale in interface OpenIdClaims
      Returns:
      End-User's locale, represented as a BCP47 [RFC5646] language tag.
    • getPhoneNumber

      @Nullable public @Nullable String getPhoneNumber()
      Specified by:
      getPhoneNumber in interface OpenIdClaims
      Returns:
      End-User's preferred telephone number
    • isPhoneNumberVerified

      @Nullable public @Nullable Boolean isPhoneNumberVerified()
      Specified by:
      isPhoneNumberVerified in interface OpenIdClaims
      Returns:
      True if the End-User's phone number has been verified; otherwise false.
    • getAdress

      @Nullable public @Nullable Address getAdress()
      Description copied from interface: OpenIdClaims
      address.
      Specified by:
      getAdress in interface OpenIdClaims
      Returns:
      End-User's preferred postal address.
    • getUpdatedAt

      @Nullable public @Nullable Integer getUpdatedAt()
      Specified by:
      getUpdatedAt in interface OpenIdClaims
      Returns:
      Time the End-User's information was last updated.
    • getClaims

      public Map<String,Object> getClaims()
      Specified by:
      getClaims in interface OpenIdClaims
      Returns:
      ID token claims
    • get

      @Nullable public @Nullable Object get(String claimName)
      Description copied from interface: Claims
      Retrieves a value from the claims for the given name.
      Specified by:
      get in interface Claims
      Parameters:
      claimName - the claim name
      Returns:
      null if the claim not exist or the claim value.
    • names

      @NonNull public @NonNull Set<String> names()
      Specified by:
      names in interface Claims
      Returns:
      All claim names.
    • contains

      public boolean contains(String claimName)
      Specified by:
      contains in interface Claims
      Parameters:
      claimName - the claim name
      Returns:
      false if the claim does not exist.