Class TokenSettings.Builder
java.lang.Object
org.springframework.security.oauth2.server.authorization.settings.AbstractSettings.AbstractBuilder<TokenSettings,TokenSettings.Builder>
org.springframework.security.oauth2.server.authorization.settings.TokenSettings.Builder
- Enclosing class:
- TokenSettings
public static final class TokenSettings.Builder
extends AbstractSettings.AbstractBuilder<TokenSettings,TokenSettings.Builder>
A builder for
TokenSettings.-
Method Summary
Modifier and TypeMethodDescriptionaccessTokenFormat(OAuth2TokenFormat accessTokenFormat) Set the token format for an access token.accessTokenTimeToLive(Duration accessTokenTimeToLive) Set the time-to-live for an access token.authorizationCodeTimeToLive(Duration authorizationCodeTimeToLive) Set the time-to-live for an authorization code.build()Builds theTokenSettings.deviceCodeTimeToLive(Duration deviceCodeTimeToLive) Set the time-to-live for a device code.idTokenSignatureAlgorithm(org.springframework.security.oauth2.jose.jws.SignatureAlgorithm idTokenSignatureAlgorithm) Sets theJWSalgorithm for signing theID Token.refreshTokenTimeToLive(Duration refreshTokenTimeToLive) Set the time-to-live for a refresh token.reuseRefreshTokens(boolean reuseRefreshTokens) Set totrueif refresh tokens are reused when returning the access token response, orfalseif a new refresh token is issued.x509CertificateBoundAccessTokens(boolean x509CertificateBoundAccessTokens) Set totrueif access tokens must be bound to the clientX509Certificatereceived during client authentication when using thetls_client_authorself_signed_tls_client_authmethod.Methods inherited from class org.springframework.security.oauth2.server.authorization.settings.AbstractSettings.AbstractBuilder
getSettings, getThis, setting, settings
-
Method Details
-
authorizationCodeTimeToLive
Set the time-to-live for an authorization code. Must be greater thanDuration.ZERO. A maximum authorization code lifetime of 10 minutes is RECOMMENDED.- Parameters:
authorizationCodeTimeToLive- the time-to-live for an authorization code- Returns:
- the
TokenSettings.Builderfor further configuration - Since:
- 0.4.0
-
accessTokenTimeToLive
Set the time-to-live for an access token. Must be greater thanDuration.ZERO.- Parameters:
accessTokenTimeToLive- the time-to-live for an access token- Returns:
- the
TokenSettings.Builderfor further configuration
-
accessTokenFormat
Set the token format for an access token.- Parameters:
accessTokenFormat- the token format for an access token- Returns:
- the
TokenSettings.Builderfor further configuration - Since:
- 0.2.3
-
deviceCodeTimeToLive
Set the time-to-live for a device code. Must be greater thanDuration.ZERO.- Parameters:
deviceCodeTimeToLive- the time-to-live for a device code- Returns:
- the
TokenSettings.Builderfor further configuration - Since:
- 1.1
-
reuseRefreshTokens
Set totrueif refresh tokens are reused when returning the access token response, orfalseif a new refresh token is issued.- Parameters:
reuseRefreshTokens-trueto reuse refresh tokens,falseto issue new refresh tokens- Returns:
- the
TokenSettings.Builderfor further configuration
-
refreshTokenTimeToLive
Set the time-to-live for a refresh token. Must be greater thanDuration.ZERO.- Parameters:
refreshTokenTimeToLive- the time-to-live for a refresh token- Returns:
- the
TokenSettings.Builderfor further configuration
-
idTokenSignatureAlgorithm
public TokenSettings.Builder idTokenSignatureAlgorithm(org.springframework.security.oauth2.jose.jws.SignatureAlgorithm idTokenSignatureAlgorithm) Sets theJWSalgorithm for signing theID Token.- Parameters:
idTokenSignatureAlgorithm- theJWSalgorithm for signing theID Token- Returns:
- the
TokenSettings.Builderfor further configuration
-
x509CertificateBoundAccessTokens
public TokenSettings.Builder x509CertificateBoundAccessTokens(boolean x509CertificateBoundAccessTokens) Set totrueif access tokens must be bound to the clientX509Certificatereceived during client authentication when using thetls_client_authorself_signed_tls_client_authmethod.- Parameters:
x509CertificateBoundAccessTokens-trueif access tokens must be bound to the clientX509Certificate,falseotherwise- Returns:
- the
TokenSettings.Builderfor further configuration - Since:
- 1.3
-
build
Builds theTokenSettings.- Specified by:
buildin classAbstractSettings.AbstractBuilder<TokenSettings,TokenSettings.Builder> - Returns:
- the
TokenSettings
-