Class OidcIdToken
- java.lang.Object
-
- org.springframework.security.oauth2.core.AbstractOAuth2Token
-
- org.springframework.security.oauth2.core.oidc.OidcIdToken
-
- All Implemented Interfaces:
java.io.Serializable
,ClaimAccessor
,OAuth2Token
,IdTokenClaimAccessor
,StandardClaimAccessor
public class OidcIdToken extends AbstractOAuth2Token implements IdTokenClaimAccessor
An implementation of anAbstractOAuth2Token
representing an OpenID Connect Core 1.0 ID Token.The
OidcIdToken
is a security token that contains "claims" about the authentication of an End-User by an Authorization Server.- Since:
- 5.0
- See Also:
AbstractOAuth2Token
,IdTokenClaimAccessor
,StandardClaimAccessor
, ID Token, Standard Claims, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OidcIdToken.Builder
A builder forOidcIdToken
s
-
Constructor Summary
Constructors Constructor Description OidcIdToken(java.lang.String tokenValue, java.time.Instant issuedAt, java.time.Instant expiresAt, java.util.Map<java.lang.String,java.lang.Object> claims)
Constructs aOidcIdToken
using the provided parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
getClaims()
Returns a set of claims that may be used for assertions.static OidcIdToken.Builder
withTokenValue(java.lang.String tokenValue)
Create aOidcIdToken.Builder
based on the given token value-
Methods inherited from class org.springframework.security.oauth2.core.AbstractOAuth2Token
equals, getExpiresAt, getIssuedAt, getTokenValue, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.security.oauth2.core.ClaimAccessor
containsClaim, getClaim, getClaimAsBoolean, getClaimAsInstant, getClaimAsMap, getClaimAsString, getClaimAsStringList, getClaimAsURL, hasClaim
-
Methods inherited from interface org.springframework.security.oauth2.core.oidc.IdTokenClaimAccessor
getAccessTokenHash, getAudience, getAuthenticatedAt, getAuthenticationContextClass, getAuthenticationMethods, getAuthorizationCodeHash, getAuthorizedParty, getExpiresAt, getIssuedAt, getIssuer, getNonce, getSubject
-
Methods inherited from interface org.springframework.security.oauth2.core.oidc.StandardClaimAccessor
getAddress, getBirthdate, getEmail, getEmailVerified, getFamilyName, getFullName, getGender, getGivenName, getLocale, getMiddleName, getNickName, getPhoneNumber, getPhoneNumberVerified, getPicture, getPreferredUsername, getProfile, getUpdatedAt, getWebsite, getZoneInfo
-
-
-
-
Constructor Detail
-
OidcIdToken
public OidcIdToken(java.lang.String tokenValue, java.time.Instant issuedAt, java.time.Instant expiresAt, java.util.Map<java.lang.String,java.lang.Object> claims)
Constructs aOidcIdToken
using the provided parameters.- Parameters:
tokenValue
- the ID Token valueissuedAt
- the time at which the ID Token was issued(iat)
expiresAt
- the expiration time(exp)
on or after which the ID Token MUST NOT be acceptedclaims
- the claims about the authentication of the End-User
-
-
Method Detail
-
getClaims
public java.util.Map<java.lang.String,java.lang.Object> getClaims()
Description copied from interface:ClaimAccessor
Returns a set of claims that may be used for assertions.- Specified by:
getClaims
in interfaceClaimAccessor
- Returns:
- a
Map
of claims
-
withTokenValue
public static OidcIdToken.Builder withTokenValue(java.lang.String tokenValue)
Create aOidcIdToken.Builder
based on the given token value- Parameters:
tokenValue
- the token value to use- Returns:
- the
OidcIdToken.Builder
for further configuration - Since:
- 5.3
-
-