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 theJWS
algorithm for signing theID Token
.refreshTokenTimeToLive
(Duration refreshTokenTimeToLive) Set the time-to-live for a refresh token.reuseRefreshTokens
(boolean reuseRefreshTokens) Set totrue
if refresh tokens are reused when returning the access token response, orfalse
if a new refresh token is issued.x509CertificateBoundAccessTokens
(boolean x509CertificateBoundAccessTokens) Set totrue
if access tokens must be bound to the clientX509Certificate
received during client authentication when using thetls_client_auth
orself_signed_tls_client_auth
method.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.Builder
for 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.Builder
for further configuration
-
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
-
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.Builder
for further configuration - Since:
- 1.1
-
reuseRefreshTokens
Set totrue
if refresh tokens are reused when returning the access token response, orfalse
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
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.Builder
for further configuration
-
idTokenSignatureAlgorithm
public TokenSettings.Builder idTokenSignatureAlgorithm(org.springframework.security.oauth2.jose.jws.SignatureAlgorithm idTokenSignatureAlgorithm) Sets theJWS
algorithm for signing theID Token
.- Parameters:
idTokenSignatureAlgorithm
- theJWS
algorithm for signing theID Token
- Returns:
- the
TokenSettings.Builder
for further configuration
-
x509CertificateBoundAccessTokens
public TokenSettings.Builder x509CertificateBoundAccessTokens(boolean x509CertificateBoundAccessTokens) Set totrue
if access tokens must be bound to the clientX509Certificate
received during client authentication when using thetls_client_auth
orself_signed_tls_client_auth
method.- Parameters:
x509CertificateBoundAccessTokens
-true
if access tokens must be bound to the clientX509Certificate
,false
otherwise- Returns:
- the
TokenSettings.Builder
for further configuration - Since:
- 1.3
-
build
Builds theTokenSettings
.- Specified by:
build
in classAbstractSettings.AbstractBuilder<TokenSettings,
TokenSettings.Builder> - Returns:
- the
TokenSettings
-