Class OAuth2AccessTokenResponse.Builder
- java.lang.Object
-
- org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse.Builder
-
- Enclosing class:
- OAuth2AccessTokenResponse
public static final class OAuth2AccessTokenResponse.Builder extends java.lang.ObjectA builder forOAuth2AccessTokenResponse.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2AccessTokenResponse.BuilderadditionalParameters(java.util.Map<java.lang.String,java.lang.Object> additionalParameters)Sets the additional parameters returned in the response.OAuth2AccessTokenResponsebuild()Builds a newOAuth2AccessTokenResponse.OAuth2AccessTokenResponse.BuilderexpiresIn(long expiresIn)Sets the lifetime (in seconds) of the access token.OAuth2AccessTokenResponse.BuilderrefreshToken(java.lang.String refreshToken)Sets the refresh token associated to the access token.OAuth2AccessTokenResponse.Builderscopes(java.util.Set<java.lang.String> scopes)Sets the scope(s) associated to the access token.OAuth2AccessTokenResponse.BuildertokenType(OAuth2AccessToken.TokenType tokenType)Sets thetoken type.
-
-
-
Method Detail
-
tokenType
public OAuth2AccessTokenResponse.Builder tokenType(OAuth2AccessToken.TokenType tokenType)
Sets thetoken type.- Parameters:
tokenType- the type of token issued- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
expiresIn
public OAuth2AccessTokenResponse.Builder expiresIn(long expiresIn)
Sets the lifetime (in seconds) of the access token.- Parameters:
expiresIn- the lifetime of the access token, in seconds.- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
scopes
public OAuth2AccessTokenResponse.Builder scopes(java.util.Set<java.lang.String> scopes)
Sets the scope(s) associated to the access token.- Parameters:
scopes- the scope(s) associated to the access token.- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
refreshToken
public OAuth2AccessTokenResponse.Builder refreshToken(java.lang.String refreshToken)
Sets the refresh token associated to the access token.- Parameters:
refreshToken- the refresh token associated to the access token.- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
additionalParameters
public OAuth2AccessTokenResponse.Builder additionalParameters(java.util.Map<java.lang.String,java.lang.Object> additionalParameters)
Sets the additional parameters returned in the response.- Parameters:
additionalParameters- the additional parameters returned in the response- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
build
public OAuth2AccessTokenResponse build()
Builds a newOAuth2AccessTokenResponse.- Returns:
- a
OAuth2AccessTokenResponse
-
-