Package com.pingidentity.sdk.token
Class GenericTokenRequest
java.lang.Object
com.pingidentity.sdk.token.GenericTokenRequest
- All Implemented Interfaces:
TokenRequest
A generic implementation of the
TokenRequest interface.
This class provides a simple bean implementation for holding token request data, along with a builder for easy construction.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic GenericTokenRequest.Builderbuilder()Creates a new builder forGenericTokenRequest.Returns the Audience (aud) claim.Returns a map of claims that should be added to the token.Returns the Client ID, often used for the Issuer (iss) and Subject (sub) claims.getJti()Returns the JWT ID (jti) claim.floatReturns the lifetime of the token in minutes.Returns the signing configuration for the token.getType()Returns the Type (typ) header parameter value.booleanIndicates whether the Not Before (nbf) claim should be included in the token.voidsetAudience(String audience) Sets the Audience (aud) claim.voidsetClaimsOverride(Map<String, Object> claims) Sets the claims to override in the issued token.voidsetClientId(String clientId) Sets the Client ID.voidsetIncludeNotBeforeClaim(boolean includeNotBeforeClaim) Sets whether to include the Not Before (nbf) claim.voidSets the JWT ID (jti) claim.voidsetLifetime(float lifetime) Sets the lifetime of the token in minutes.voidsetSigningConfig(TokenSigningConfig signingConfig) Sets the signing configuration for the token.voidSets the Type (typ) header parameter value.
-
Method Details
-
getSigningConfig
Returns the signing configuration for the token.- Specified by:
getSigningConfigin interfaceTokenRequest- Returns:
- the
TokenSigningConfig
-
setSigningConfig
Sets the signing configuration for the token.- Parameters:
signingConfig- theTokenSigningConfigto set
-
getJti
Returns the JWT ID (jti) claim.- Specified by:
getJtiin interfaceTokenRequest- Returns:
- the jti claim, or null if one should be generated automatically
-
setJti
Sets the JWT ID (jti) claim.- Parameters:
jti- the jti value
-
getClientId
Returns the Client ID, often used for the Issuer (iss) and Subject (sub) claims.- Specified by:
getClientIdin interfaceTokenRequest- Returns:
- the client ID
-
setClientId
Sets the Client ID.- Parameters:
clientId- the client ID
-
getAudience
Returns the Audience (aud) claim.- Specified by:
getAudiencein interfaceTokenRequest- Returns:
- the audience
-
setAudience
Sets the Audience (aud) claim.- Parameters:
audience- the audience value
-
getLifetime
public float getLifetime()Returns the lifetime of the token in minutes.- Specified by:
getLifetimein interfaceTokenRequest- Returns:
- the lifetime in minutes
-
setLifetime
public void setLifetime(float lifetime) Sets the lifetime of the token in minutes.- Parameters:
lifetime- the lifetime in minutes
-
includeNotBeforeClaim
public boolean includeNotBeforeClaim()Indicates whether the Not Before (nbf) claim should be included in the token.- Specified by:
includeNotBeforeClaimin interfaceTokenRequest- Returns:
- true if the nbf claim should be included, false otherwise
-
setIncludeNotBeforeClaim
public void setIncludeNotBeforeClaim(boolean includeNotBeforeClaim) Sets whether to include the Not Before (nbf) claim.- Parameters:
includeNotBeforeClaim- true to include the nbf claim, false otherwise
-
getType
Returns the Type (typ) header parameter value.- Specified by:
getTypein interfaceTokenRequest- Returns:
- the type header value
-
setType
Sets the Type (typ) header parameter value.- Parameters:
type- the type header value
-
getClaimsOverride
Returns a map of claims that should be added to the token. If a claim in this map conflicts with a default claim generated by the token service, the value in this map will take precedence.- Specified by:
getClaimsOverridein interfaceTokenRequest- Returns:
- a map of claims to include in the token
- Since:
- 13.1
-
setClaimsOverride
Sets the claims to override in the issued token.- Parameters:
claims- theMapof claims to override in the issued token- Since:
- 13.1
-
builder
Creates a new builder forGenericTokenRequest.- Returns:
- a new Builder instance
-