Enclosing class:
TokenSettings

public static final class TokenSettings.Builder extends AbstractSettings.AbstractBuilder<TokenSettings,TokenSettings.Builder>
A builder for TokenSettings.
  • Method Details

    • authorizationCodeTimeToLive

      public TokenSettings.Builder authorizationCodeTimeToLive(Duration authorizationCodeTimeToLive)
      Set the time-to-live for an authorization code. Must be greater than Duration.ZERO. A maximum authorization code lifetime of 10 minutes is RECOMMENDED.
      Parameters:
      authorizationCodeTimeToLive - the time-to-live for an authorization code
      Returns:
      the TokenSettings.Builder for further configuration
      Since:
      0.4.0
    • accessTokenTimeToLive

      public TokenSettings.Builder accessTokenTimeToLive(Duration accessTokenTimeToLive)
      Set the time-to-live for an access token. Must be greater than Duration.ZERO.
      Parameters:
      accessTokenTimeToLive - the time-to-live for an access token
      Returns:
      the TokenSettings.Builder for further configuration
    • accessTokenFormat

      public TokenSettings.Builder accessTokenFormat(OAuth2TokenFormat accessTokenFormat)
      Set the token format for an access token.
      Parameters:
      accessTokenFormat - the token format for an access token
      Returns:
      the TokenSettings.Builder for further configuration
      Since:
      0.2.3
    • reuseRefreshTokens

      public TokenSettings.Builder reuseRefreshTokens(boolean reuseRefreshTokens)
      Set to true if refresh tokens are reused when returning the access token response, or false if a new refresh token is issued.
      Parameters:
      reuseRefreshTokens - true to reuse refresh tokens, false to issue new refresh tokens
      Returns:
      the TokenSettings.Builder for further configuration
    • refreshTokenTimeToLive

      public TokenSettings.Builder refreshTokenTimeToLive(Duration refreshTokenTimeToLive)
      Set the time-to-live for a refresh token. Must be greater than Duration.ZERO.
      Parameters:
      refreshTokenTimeToLive - the time-to-live for a refresh token
      Returns:
      the TokenSettings.Builder for further configuration
    • idTokenSignatureAlgorithm

      public TokenSettings.Builder idTokenSignatureAlgorithm(org.springframework.security.oauth2.jose.jws.SignatureAlgorithm idTokenSignatureAlgorithm)
      Sets the JWS algorithm for signing the ID Token.
      Parameters:
      idTokenSignatureAlgorithm - the JWS algorithm for signing the ID Token
      Returns:
      the TokenSettings.Builder for further configuration
    • build

      public TokenSettings build()
      Builds the TokenSettings.
      Specified by:
      build in class AbstractSettings.AbstractBuilder<TokenSettings,TokenSettings.Builder>
      Returns:
      the TokenSettings