Class JWTOpenIdClaims
- java.lang.Object
-
- io.micronaut.security.oauth2.endpoint.token.response.JWTOpenIdClaims
-
- All Implemented Interfaces:
OpenIdClaims
,Claims
,JwtClaims
public class JWTOpenIdClaims extends java.lang.Object implements OpenIdClaims
An implementation ofOpenIdClaims
backed by anJWTClaimsSet
.- Since:
- 1.2.0
- Author:
- James Kleeh
-
-
Field Summary
-
Fields inherited from interface io.micronaut.security.token.jwt.generator.claims.JwtClaims
ALL_CLAIMS, AUDIENCE, EXPIRATION_TIME, ISSUED_AT, ISSUER, JWT_ID, NOT_BEFORE, SUBJECT
-
Fields inherited from interface io.micronaut.security.oauth2.endpoint.token.response.OpenIdClaims
CLAIMS_ACR, CLAIMS_ADDRESS, CLAIMS_AMR, CLAIMS_AUTH_TIME, CLAIMS_AZP, CLAIMS_BIRTHDATE, CLAIMS_EMAIL, CLAIMS_EMAIL_VERIFIED, CLAIMS_FAMILY_NAME, CLAIMS_GENDER, CLAIMS_GIVEN_NAME, CLAIMS_LOCALE, CLAIMS_MIDDLE_NAME, CLAIMS_NAME, CLAIMS_NICKNAME, CLAIMS_NONCE, CLAIMS_PHONE_NUMBER, CLAIMS_PHONE_NUMBER_VERIFIED, CLAIMS_PICTURE, CLAIMS_PREFERRED_USERNAME, CLAIMS_PROFILE, CLAIMS_UPDATED_AT, CLAIMS_WEBSITE, CLAIMS_ZONEINFO
-
-
Constructor Summary
Constructors Constructor Description JWTOpenIdClaims(com.nimbusds.jwt.JWTClaimsSet claimsSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.String claimName)
java.lang.Object
get(java.lang.String claimName)
Retrieves a value from the claims for the given name.Address
getAdress()
address.java.util.List<java.lang.String>
getAudience()
java.lang.String
getAuthenticationContextClassReference()
java.util.List<java.lang.String>
getAuthenticationMethodReferences()
java.lang.Integer
getAuthenticationTime()
java.lang.String
getAuthorizedParty()
java.lang.String
getBirthday()
java.util.Map<java.lang.String,java.lang.Object>
getClaims()
java.lang.String
getEmail()
java.util.Date
getExpirationTime()
java.lang.String
getFamilyName()
family_name.java.lang.String
getGender()
java.lang.String
getGivenName()
given_name.java.util.Date
getIssuedAt()
java.lang.String
getIssuer()
java.lang.String
getLocale()
java.lang.String
getMiddleName()
middle_name.java.lang.String
getName()
name.java.lang.String
getNickname()
nickname.java.lang.String
getNonce()
java.lang.String
getPhoneNumber()
java.lang.String
getPicture()
java.lang.String
getPreferredUsername()
preferred_username.java.lang.String
getProfile()
java.lang.String
getSubject()
sub.java.lang.Integer
getUpdatedAt()
java.lang.String
getWebsite()
java.lang.String
getZoneinfo()
zoneinfo.java.lang.Boolean
isEmailVerified()
java.lang.Boolean
isPhoneNumberVerified()
java.util.Set<java.lang.String>
names()
-
-
-
Method Detail
-
getIssuer
@Nonnull public java.lang.String getIssuer()
- Specified by:
getIssuer
in interfaceOpenIdClaims
- 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 java.util.List<java.lang.String> getAudience()
- Specified by:
getAudience
in interfaceOpenIdClaims
- Returns:
- Audience(s) that this ID Token is intended for.
-
getExpirationTime
@Nonnull public java.util.Date getExpirationTime()
- Specified by:
getExpirationTime
in interfaceOpenIdClaims
- Returns:
- Expiration time on or after which the ID Token MUST NOT be accepted for processing.
-
getIssuedAt
@Nonnull public java.util.Date getIssuedAt()
- Specified by:
getIssuedAt
in interfaceOpenIdClaims
- Returns:
- Time at which the JWT was issued.
-
getSubject
@Nonnull public java.lang.String getSubject()
Description copied from interface:OpenIdClaims
sub.- Specified by:
getSubject
in interfaceOpenIdClaims
- Returns:
- Identifier for the End-User at the Issuer.
-
getAuthorizedParty
@Nullable public java.lang.String getAuthorizedParty()
- Specified by:
getAuthorizedParty
in interfaceOpenIdClaims
- Returns:
- The party to which the ID Token was issued.
-
getAuthenticationMethodReferences
@Nullable public java.util.List<java.lang.String> getAuthenticationMethodReferences()
- Specified by:
getAuthenticationMethodReferences
in interfaceOpenIdClaims
- Returns:
- Identifiers for authentication methods used in the authentication.
-
getAuthenticationContextClassReference
@Nullable public java.lang.String getAuthenticationContextClassReference()
- Specified by:
getAuthenticationContextClassReference
in interfaceOpenIdClaims
- Returns:
- Authentication Context Class Reference.
-
getAuthenticationTime
@Nullable public java.lang.Integer getAuthenticationTime()
- Specified by:
getAuthenticationTime
in interfaceOpenIdClaims
- Returns:
- Time when the End-User authentication occurred.
-
getNonce
@Nullable public java.lang.String getNonce()
- Specified by:
getNonce
in interfaceOpenIdClaims
- Returns:
- String value used to associate a Client session with an ID Token, and to mitigate replay attacks.
-
getName
@Nullable public java.lang.String getName()
Description copied from interface:OpenIdClaims
name.- Specified by:
getName
in interfaceOpenIdClaims
- 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 java.lang.String getGivenName()
Description copied from interface:OpenIdClaims
given_name.- Specified by:
getGivenName
in interfaceOpenIdClaims
- 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 java.lang.String getFamilyName()
Description copied from interface:OpenIdClaims
family_name.- Specified by:
getFamilyName
in interfaceOpenIdClaims
- 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 java.lang.String getMiddleName()
Description copied from interface:OpenIdClaims
middle_name.- Specified by:
getMiddleName
in interfaceOpenIdClaims
- 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 java.lang.String getNickname()
Description copied from interface:OpenIdClaims
nickname.- Specified by:
getNickname
in interfaceOpenIdClaims
- 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 java.lang.String getPreferredUsername()
Description copied from interface:OpenIdClaims
preferred_username.- Specified by:
getPreferredUsername
in interfaceOpenIdClaims
- 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 java.lang.String getProfile()
- Specified by:
getProfile
in interfaceOpenIdClaims
- Returns:
- URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User.
-
getPicture
@Nullable public java.lang.String getPicture()
- Specified by:
getPicture
in interfaceOpenIdClaims
- 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 java.lang.String getWebsite()
- Specified by:
getWebsite
in interfaceOpenIdClaims
- 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 java.lang.String getEmail()
- Specified by:
getEmail
in interfaceOpenIdClaims
- 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 java.lang.Boolean isEmailVerified()
- Specified by:
isEmailVerified
in interfaceOpenIdClaims
- Returns:
- True if the End-User's e-mail address has been verified; otherwise false.
-
getGender
@Nullable public java.lang.String getGender()
- Specified by:
getGender
in interfaceOpenIdClaims
- 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 java.lang.String getBirthday()
- Specified by:
getBirthday
in interfaceOpenIdClaims
- Returns:
- End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.
-
getZoneinfo
@Nullable public java.lang.String getZoneinfo()
Description copied from interface:OpenIdClaims
zoneinfo.- Specified by:
getZoneinfo
in interfaceOpenIdClaims
- 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 java.lang.String getLocale()
- Specified by:
getLocale
in interfaceOpenIdClaims
- Returns:
- End-User's locale, represented as a BCP47 [RFC5646] language tag.
-
getPhoneNumber
@Nullable public java.lang.String getPhoneNumber()
- Specified by:
getPhoneNumber
in interfaceOpenIdClaims
- Returns:
- End-User's preferred telephone number
-
isPhoneNumberVerified
@Nullable public java.lang.Boolean isPhoneNumberVerified()
- Specified by:
isPhoneNumberVerified
in interfaceOpenIdClaims
- Returns:
- True if the End-User's phone number has been verified; otherwise false.
-
getAdress
@Nullable public Address getAdress()
Description copied from interface:OpenIdClaims
address.- Specified by:
getAdress
in interfaceOpenIdClaims
- Returns:
- End-User's preferred postal address.
-
getUpdatedAt
@Nullable public java.lang.Integer getUpdatedAt()
- Specified by:
getUpdatedAt
in interfaceOpenIdClaims
- Returns:
- Time the End-User's information was last updated.
-
getClaims
public java.util.Map<java.lang.String,java.lang.Object> getClaims()
- Specified by:
getClaims
in interfaceOpenIdClaims
- Returns:
- ID token claims
-
get
@Nullable public java.lang.Object get(java.lang.String claimName)
Description copied from interface:Claims
Retrieves a value from the claims for the given name.
-
names
@Nonnull public java.util.Set<java.lang.String> names()
-
-