Class TokenClaimsSet
java.lang.Object
net.shibboleth.idp.plugin.oidc.op.token.support.TokenClaimsSet
- Direct Known Subclasses:
AccessTokenClaimsSet,AuthorizeCodeClaimsSet,RefreshTokenClaimsSet
Class to extend for token claims sets. Offers the base functionality to Authorize Code, Refresh Token and Access
Token.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTokenClaimsSet.Builder<T extends TokenClaimsSet>Abstract builder to extend builders from that are instantiating claims sets extending TokenClaimsSet. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier for the token.static final StringAuthentication context class reference value of the performed authentication.static final StringAudiences of the token request.static final StringAuthentication time of the performed authentication.static final StringClaims request of the original authentication request.static final StringClient id of the rp the token is generated for.static final StringCode Challenge.static final StringIdentifier for the confirmation claim.static final StringWhether consent has been enabled.static final StringClaims/Attributes having consent.static final StringClaims set for token delivery.static final StringClaims set for token delivery, id token only.static final StringClaims set for token delivery, user info only.static final StringIdentifier for the DPoP Proof JWK thumbprint under confirmation claim.static final StringExpiration time of the token.static final StringIssue time of the token.static final StringOP issuer.static final StringClient id of the rp the token is generated for (old constant).static final StringNonce of the original authentication request.static final StringNot before time of the token.static final StringRedirect uri of the original authentication request.static final StringIdentifier for the root token in the chain.static final StringScope of the token request.static final StringCustom claim name for sealed claims embedded inside JWT.static final StringIdentifier for the session id.static final StringSubject of the user.static final StringType of the token.static final StringUser principal representing authenticated user.private org.slf4j.LoggerClass logger.private JWTClaimsSetClaims set for the claim. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for some subclasses.protectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected JWTClaimsSetGet the token claims set.getACR()Get acr of the performed authentication.Get audience of the token.Get auth time of the user.Get claims request of the authentication request.Get the token claims set.Get Client ID of the token.Get code challenge of the authentication request.Get consented claims.Get token delivery claims.Get the DPoP Proof JWK thumbprint.getExp()Get expiration time of the token.getID()Get the id of the token.Get id token token delivery claims.Get issuance time of the token.Get the issuer.getNonce()Get nonce of the authentication request.Get not before time of the token, if any.Get principal of the user.Get redirect uri of the request.Get the root token identifier.getScope()Get scope of the token.Get the session identifier.Get subject claim.getType()Get type of the claims set.Get user info response token delivery claims.booleanGet whether consent has been enabled.booleanCheck if the token is valid with respect to expiration and not before limits.Serialize the token as JSON String.serialize(DataSealer dataSealer) Serialize the token as JSON String wrapped with sealer.voidsetClaimsSet(JWTClaimsSet claimsSet) Set the token claims set.protected static voidverifyParsedClaims(String tokenType, JWTClaimsSet tokenClaimsSet) Helper to verify parsed claims are what is expected.
-
Field Details
-
KEY_AC_ID
Identifier for the token.- See Also:
-
KEY_TYPE
Type of the token.- See Also:
-
KEY_ISSUER
OP issuer.- See Also:
-
KEY_USER_PRINCIPAL
User principal representing authenticated user.- See Also:
-
KEY_SUBJECT
Subject of the user.- See Also:
-
KEY_CLIENTID
Client id of the rp the token is generated for.- See Also:
-
KEY_LEGACY_CLIENTID
Client id of the rp the token is generated for (old constant).- See Also:
-
KEY_EXPIRATION_TIME
Expiration time of the token.- See Also:
-
KEY_NOTBEFORE_TIME
Not before time of the token.- See Also:
-
KEY_ISSUED_AT
Issue time of the token.- See Also:
-
KEY_ACR
Authentication context class reference value of the performed authentication.- See Also:
-
KEY_NONCE
Nonce of the original authentication request.- See Also:
-
KEY_AUTH_TIME
Authentication time of the performed authentication.- See Also:
-
KEY_REDIRECT_URI
Redirect uri of the original authentication request.- See Also:
-
KEY_SCOPE
Scope of the token request.- See Also:
-
KEY_AUDIENCE
Audiences of the token request.- See Also:
-
KEY_CLAIMS
Claims request of the original authentication request.- See Also:
-
KEY_DELIVERY_CLAIMS
Claims set for token delivery.- See Also:
-
KEY_DELIVERY_CLAIMS_IDTOKEN
Claims set for token delivery, id token only.- See Also:
-
KEY_DELIVERY_CLAIMS_USERINFO
Claims set for token delivery, user info only.- See Also:
-
KEY_CONSENTED_CLAIMS
Claims/Attributes having consent.- See Also:
-
KEY_CONSENT_ENABLED
Whether consent has been enabled.- See Also:
-
KEY_CODE_CHALLENGE
Code Challenge.- See Also:
-
KEY_SEALED_FOR_OP
Custom claim name for sealed claims embedded inside JWT.- See Also:
-
KEY_ROOT_JTI
Identifier for the root token in the chain.- See Also:
-
KEY_SESSION_ID
Identifier for the session id.- See Also:
-
KEY_CONFIRMATION
Identifier for the confirmation claim.- See Also:
-
KEY_DPOP_PROOF_JWK_THUMBPRINT
Identifier for the DPoP Proof JWK thumbprint under confirmation claim.- See Also:
-
tokenClaimsSet
Claims set for the claim. -
log
@Nonnull private org.slf4j.Logger logClass logger.
-
-
Constructor Details
-
TokenClaimsSet
protected TokenClaimsSet()Default constructor for some subclasses. -
TokenClaimsSet
Constructor.- Parameters:
jwt- the claim set to wrap- Since:
- 3.1.0
-
-
Method Details
-
verifyParsedClaims
protected static void verifyParsedClaims(@Nonnull @NotEmpty String tokenType, @Nonnull JWTClaimsSet tokenClaimsSet) throws ParseException Helper to verify parsed claims are what is expected.- Parameters:
tokenType- The type of the expected tokentokenClaimsSet- token claims set- Throws:
ParseException- if claims set is not expected one.
-
serialize
Serialize the token as JSON String.- Returns:
- token as JSON String
-
setClaimsSet
Set the token claims set.- Parameters:
claimsSet- What to set
-
getClaimsSet
Get the token claims set.- Returns:
- token claims set
-
assertedClaimsSet
Get the token claims set. If the claims set is null aConstraintViolationExceptionis thrown.- Returns:
- token claims set
- Since:
- 4.1.0
-
getIssuer
Get the issuer.- Returns:
- issuer
- Since:
- 3.1.0
-
getIssuedAt
Get issuance time of the token.- Returns:
- issuance time
- Since:
- 3.1.0
-
getExp
Get expiration time of the token.- Returns:
- expiration time of the token
-
getNotBefore
Get not before time of the token, if any.- Returns:
- not before time of the token
- Since:
- 3.1.0
-
isTimeValid
public boolean isTimeValid()Check if the token is valid with respect to expiration and not before limits.- Returns:
- true iff token is time valid
- Since:
- 3.1.0
-
getRedirectURI
Get redirect uri of the request.- Returns:
- redirect uri of the request, null if not located.
-
getACR
Get acr of the performed authentication.- Returns:
- acr of the performed authentication.
-
getType
Get type of the claims set.- Returns:
- Type of the claims set.
-
getPrincipal
Get principal of the user.- Returns:
- principal of the user.
-
getSubject
Get subject claim.- Returns:
- subject claim
- Since:
- 3.1.0
-
getAuthenticationTime
Get auth time of the user.- Returns:
- auth time of the user.
-
getNonce
Get nonce of the authentication request.- Returns:
- nonce of the authentication request.
-
getClaimsRequest
Get claims request of the authentication request.- Returns:
- claims request in authentication request, null if not existing.
-
getDeliveryClaims
Get token delivery claims.- Returns:
- token delivery claims
-
getIDTokenDeliveryClaims
Get id token token delivery claims.- Returns:
- id token token delivery claims
-
getUserinfoDeliveryClaims
Get user info response token delivery claims.- Returns:
- user info response token delivery claims
-
getConsentedClaims
Get consented claims.- Returns:
- consented claims
-
isConsentEnabled
public boolean isConsentEnabled()Get whether consent has been enabled.- Returns:
- whether consent has been enabled
-
getScope
Get scope of the token.- Returns:
- scope of the token
-
getAudience
Get audience of the token.- Returns:
- audience of the token
- Since:
- 3.1.0
-
getCodeChallenge
Get code challenge of the authentication request.- Returns:
- code challenge of the authentication request.
-
getID
Get the id of the token.- Returns:
- id of the token
-
getClientID
Get Client ID of the token.- Returns:
- Client ID of the token
-
getRootTokenIdentifier
Get the root token identifier.- Returns:
- the root token identifier.
- Since:
- 3.2.0
-
getSessionIdentifier
Get the session identifier.- Returns:
- the session identifier.
- Since:
- 3.3.0
-
getDpopProofJwkThumbprint
Get the DPoP Proof JWK thumbprint.- Returns:
- the DPoP Proof JWK thumbprint.
- Since:
- 4.2.0
-