Class GenericTokenRequest

java.lang.Object
com.pingidentity.sdk.token.GenericTokenRequest
All Implemented Interfaces:
TokenRequest

public class GenericTokenRequest extends Object implements 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.

  • Method Details

    • getSigningConfig

      public TokenSigningConfig getSigningConfig()
      Returns the signing configuration for the token.
      Specified by:
      getSigningConfig in interface TokenRequest
      Returns:
      the TokenSigningConfig
    • setSigningConfig

      public void setSigningConfig(TokenSigningConfig signingConfig)
      Sets the signing configuration for the token.
      Parameters:
      signingConfig - the TokenSigningConfig to set
    • getJti

      public String getJti()
      Returns the JWT ID (jti) claim.
      Specified by:
      getJti in interface TokenRequest
      Returns:
      the jti claim, or null if one should be generated automatically
    • setJti

      public void setJti(String jti)
      Sets the JWT ID (jti) claim.
      Parameters:
      jti - the jti value
    • getClientId

      public String getClientId()
      Returns the Client ID, often used for the Issuer (iss) and Subject (sub) claims.
      Specified by:
      getClientId in interface TokenRequest
      Returns:
      the client ID
    • setClientId

      public void setClientId(String clientId)
      Sets the Client ID.
      Parameters:
      clientId - the client ID
    • getAudience

      public String getAudience()
      Returns the Audience (aud) claim.
      Specified by:
      getAudience in interface TokenRequest
      Returns:
      the audience
    • setAudience

      public void setAudience(String audience)
      Sets the Audience (aud) claim.
      Parameters:
      audience - the audience value
    • getLifetime

      public float getLifetime()
      Returns the lifetime of the token in minutes.
      Specified by:
      getLifetime in interface TokenRequest
      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:
      includeNotBeforeClaim in interface TokenRequest
      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

      public String getType()
      Returns the Type (typ) header parameter value.
      Specified by:
      getType in interface TokenRequest
      Returns:
      the type header value
    • setType

      public void setType(String type)
      Sets the Type (typ) header parameter value.
      Parameters:
      type - the type header value
    • getClaimsOverride

      public Map<String,Object> 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:
      getClaimsOverride in interface TokenRequest
      Returns:
      a map of claims to include in the token
      Since:
      13.1
    • setClaimsOverride

      public void setClaimsOverride(Map<String,Object> claims)
      Sets the claims to override in the issued token.
      Parameters:
      claims - the Map of claims to override in the issued token
      Since:
      13.1
    • builder

      public static GenericTokenRequest.Builder builder()
      Creates a new builder for GenericTokenRequest.
      Returns:
      a new Builder instance