java.lang.Object
org.springframework.security.oauth2.server.authorization.settings.AbstractSettings
org.springframework.security.oauth2.server.authorization.settings.TokenSettings
All Implemented Interfaces:
Serializable

public final class TokenSettings extends AbstractSettings
A facility for token configuration settings.
Since:
0.0.2
See Also:
  • Method Details

    • getAuthorizationCodeTimeToLive

      public Duration getAuthorizationCodeTimeToLive()
      Returns the time-to-live for an authorization code. The default is 5 minutes.
      Returns:
      the time-to-live for an authorization code
      Since:
      0.4.0
    • getAccessTokenTimeToLive

      public Duration getAccessTokenTimeToLive()
      Returns the time-to-live for an access token. The default is 5 minutes.
      Returns:
      the time-to-live for an access token
    • getAccessTokenFormat

      public OAuth2TokenFormat getAccessTokenFormat()
      Returns the token format for an access token. The default is OAuth2TokenFormat.SELF_CONTAINED.
      Returns:
      the token format for an access token
      Since:
      0.2.3
    • getDeviceCodeTimeToLive

      public Duration getDeviceCodeTimeToLive()
      Returns the time-to-live for a device code. The default is 5 minutes.
      Returns:
      the time-to-live for a device code
      Since:
      1.1
    • isReuseRefreshTokens

      public boolean isReuseRefreshTokens()
      Returns true if refresh tokens are reused when returning the access token response, or false if a new refresh token is issued. The default is true.
    • getRefreshTokenTimeToLive

      public Duration getRefreshTokenTimeToLive()
      Returns the time-to-live for a refresh token. The default is 60 minutes.
      Returns:
      the time-to-live for a refresh token
    • getIdTokenSignatureAlgorithm

      public org.springframework.security.oauth2.jose.jws.SignatureAlgorithm getIdTokenSignatureAlgorithm()
      Returns the JWS algorithm for signing the ID Token. The default is RS256.
      Returns:
      the JWS algorithm for signing the ID Token
    • builder

      public static TokenSettings.Builder builder()
      Constructs a new TokenSettings.Builder with the default settings.
      Returns:
      the TokenSettings.Builder
    • withSettings

      public static TokenSettings.Builder withSettings(Map<String,Object> settings)
      Constructs a new TokenSettings.Builder with the provided settings.
      Parameters:
      settings - the settings to initialize the builder
      Returns:
      the TokenSettings.Builder