Class TokenClaimsSet.Builder<T extends TokenClaimsSet>
java.lang.Object
net.shibboleth.idp.plugin.oidc.op.token.support.TokenClaimsSet.Builder<T>
- Type Parameters:
T- claim set type
- Direct Known Subclasses:
AccessTokenClaimsSet.Builder,AuthorizeCodeClaimsSet.Builder,RefreshTokenClaimsSet.Builder
- Enclosing class:
- TokenClaimsSet
Abstract builder to extend builders from that are instantiating claims sets extending TokenClaimsSet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ACRAuthentication context class reference value of the authentication.Audience of token request.protected InstantAuthentication time of the user.protected StringCode challenge.consented claims.protected BooleanHas consent been asked from the end-user.Extends the token with custom claims.protected ClaimsSetToken delivery claims delivered both for id token and userinfo response.protected ClaimsSetToken delivery claims delivered for id token.protected ClaimsSetToken delivery claims delivered for userinfo response.protected StringDPoP Proof JWK thumbprint.protected InstantExpiration time of the claims set.protected InstantIssue time of the claims set.protected StringOP issuer value.protected StringToken ID.protected InstantNot Before time of the claims set.protected NonceNonce of the authentication request.protected StringUser Principal of the authenticated user.protected URIValidated redirect URI of the authentication request.protected OIDCClaimsRequestClaims request of the authentication request.protected ScopeScope of the token request.protected StringRoot token identifier.protected ClientIDClient Id of the rp.protected StringSession identifier.protected StringSubject claim value of the authenticated user. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCustomClaim(String name, Object value) Add a custom claim.abstract Tbuild()Builds claims set.protected JWTClaimsSetbuildJWTClaimsSet(String tokenType) Produce the underlying JWT to pass into the constructor methods.Set authentication context class reference value of the authentication.setAudience(Collection<String> aud) Set audience.Set authentication time.setClaimsRequest(OIDCClaimsRequest claimsRequest) Set claims request of the authentication request.setClientID(ClientID id) Set client ID.setCodeChallenge(String challenge) Set code challenge.setConsentedClaims(List<Object> claims) Set consented claims.setConsentEnabled(Boolean flag) Set whether consent has been enabled.setCustomClaims(JSONObject claims) Sets a batch of custom claim from aJSONObject.setDlClaims(ClaimsSet claims) Set token delivery claims delivered both for id token and userinfo response.setDlClaimsID(ClaimsSet claims) Set token delivery claims delivered for id token.setDlClaimsUI(ClaimsSet claims) Set token delivery claims delivered for userinfo response.Set DPoP Proof JWK thumbprint.Set expiration time.Set issue time.Set issuer.Set JWT ID.setJWTID(IdentifierGenerationStrategy generator) Set JWT ID via generator.setJWTID(IdentifierGenerationStrategy generator, boolean xmlSafe) Set JWT ID via generator.Set nonce of the authentication request.Set not before time.Set user principal name.setRedirectURI(URI uri) Set redirect URI.Set root token identifier.Set scope.Set session identifier.setSubject(String s) Set subject name.
-
Field Details
-
jwtid
Token ID. -
rpId
Client Id of the rp. -
iss
OP issuer value. -
principal
User Principal of the authenticated user. -
sub
Subject claim value of the authenticated user. -
acr
Authentication context class reference value of the authentication. -
iat
Issue time of the claims set. -
exp
Expiration time of the claims set. -
nbt
Not Before time of the claims set. -
authTime
Authentication time of the user. -
redirect
Validated redirect URI of the authentication request. -
reqScope
Scope of the token request. -
audience
Audience of token request. -
nonce
Nonce of the authentication request. -
reqClaims
Claims request of the authentication request. -
dlClaims
Token delivery claims delivered both for id token and userinfo response. -
dlClaimsID
Token delivery claims delivered for id token. -
dlClaimsUI
Token delivery claims delivered for userinfo response. -
consentedClaims
consented claims. -
consentEnabled
Has consent been asked from the end-user. -
codeChallenge
Code challenge. -
customClaims
Extends the token with custom claims. -
rootTokenId
Root token identifier. -
sessionId
Session identifier. -
dpopProofJwkThumbprint
DPoP Proof JWK thumbprint.
-
-
Constructor Details
-
Builder
protected Builder()Default constructor.
-
-
Method Details
-
buildJWTClaimsSet
Produce the underlying JWT to pass into the constructor methods.Used by subclasses to manufacture the input required to build the object.
- Parameters:
tokenType- a type designation- Returns:
- the JWT claims set
- Since:
- 3.1.0
-
setJWTID
Set JWT ID.- Parameters:
id- id- Returns:
- the builder
- Since:
- 3.1.0
-
setClientID
Set client ID.- Parameters:
id- client ID- Returns:
- the builder
- Since:
- 3.1.0
-
setIssuer
Set issuer.- Parameters:
s- issuer- Returns:
- the builder
- Since:
- 3.1.0
-
setPrincipal
Set user principal name.- Parameters:
s- principal name- Returns:
- the builder
- Since:
- 3.1.0
-
setSubject
Set subject name.- Parameters:
s- subject name- Returns:
- the builder
- Since:
- 3.1.0
-
setIssuedAt
Set issue time.- Parameters:
i- time- Returns:
- the builder
- Since:
- 3.1.0
-
setExpiresAt
Set expiration time.- Parameters:
i- time- Returns:
- the builder
- Since:
- 3.1.0
-
setNotBefore
Set not before time.- Parameters:
i- time- Returns:
- the builder
- Since:
- 3.1.0
-
setRedirectURI
Set redirect URI.- Parameters:
uri- redirect URI- Returns:
- the builder
- Since:
- 3.1.0
-
setScope
Set scope.- Parameters:
s- scope- Returns:
- the builder
- Since:
- 3.1.0
-
setAudience
Set audience.- Parameters:
aud- audience- Returns:
- the builder
- Since:
- 3.1.0
-
setAuthenticationTime
Set authentication time.- Parameters:
i- time- Returns:
- the builder
- Since:
- 3.1.0
-
setACR
Set authentication context class reference value of the authentication.- Parameters:
authenticationContextReference- authentication context class reference value of the authentication.- Returns:
- the builder
-
setNonce
Set nonce of the authentication request.- Parameters:
requestNonce- nonce of the authentication request.- Returns:
- the builder
-
setClaimsRequest
Set claims request of the authentication request.- Parameters:
claimsRequest- claims request of the authentication request.- Returns:
- the builder
- Since:
- 3.1.0
-
setDlClaims
Set token delivery claims delivered both for id token and userinfo response.- Parameters:
claims- token delivery claims delivered both for id token and userinfo response.- Returns:
- the builder
-
setDlClaimsID
Set token delivery claims delivered for id token.- Parameters:
claims- token delivery claims delivered for id token- Returns:
- the builder
-
setDlClaimsUI
Set token delivery claims delivered for userinfo response.- Parameters:
claims- token delivery claims delivered for userinfo response- Returns:
- the builder
-
setConsentedClaims
Set consented claims.- Parameters:
claims- consented claims- Returns:
- the builder
-
setConsentEnabled
Set whether consent has been enabled.- Parameters:
flag- whether consent has been enabled.- Returns:
- the builder
-
setCodeChallenge
Set code challenge.- Parameters:
challenge- code challenge- Returns:
- the builder
-
addCustomClaim
public TokenClaimsSet.Builder<T> addCustomClaim(@Nonnull @NotEmpty String name, @Nullable Object value) Add a custom claim.This method does NOT check for overlap with existing claim names.
- Parameters:
name- claim namevalue- claim value- Returns:
- this builder
- Since:
- 3.1.0
-
setCustomClaims
Sets a batch of custom claim from aJSONObject.This method does NOT check for overlap with existing claim names.
- Parameters:
claims- the claims- Returns:
- this builder
- Since:
- 3.1.0
-
setRootTokenIdentifier
Set root token identifier.- Parameters:
id- root token identifier- Returns:
- the builder
- Since:
- 3.2.0
-
setSessionIdentifier
Set session identifier.- Parameters:
id- session identifier- Returns:
- the builder
- Since:
- 3.3.0
-
setDpopProofJwkThumbprint
Set DPoP Proof JWK thumbprint.- Parameters:
jkt- DPoP Proof JWK thumbprint- Returns:
- the builder
- Since:
- 4.2.0
-
build
Builds claims set.- Returns:
- claims set instance.
-