Class OAuth2AccessTokenResponse.Builder
java.lang.Object
org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse.Builder
- Enclosing class:
OAuth2AccessTokenResponse
A builder for
OAuth2AccessTokenResponse.- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptionadditionalParameters(@Nullable Map<String, Object> additionalParameters) Sets the additional parameters returned in the response.build()Builds a newOAuth2AccessTokenResponse.expiresIn(long expiresIn) Sets the lifetime (in seconds) of the access token.refreshToken(@Nullable String refreshToken) Sets the refresh token associated to the access token.Sets the scope(s) associated to the access token.tokenType(@Nullable OAuth2AccessToken.TokenType tokenType) Sets thetoken type.
-
Method Details
-
tokenType
Sets thetoken type.- Parameters:
tokenType- the type of token issued, may benull- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
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
Sets the scope(s) associated to the access token.- Parameters:
scopes- the scope(s) associated to the access token, may benull- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
refreshToken
Sets the refresh token associated to the access token.- Parameters:
refreshToken- the refresh token associated to the access token, may benull- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
additionalParameters
public OAuth2AccessTokenResponse.Builder additionalParameters(@Nullable Map<String, Object> additionalParameters) Sets the additional parameters returned in the response.- Parameters:
additionalParameters- the additional parameters returned in the response, may benull- Returns:
- the
OAuth2AccessTokenResponse.Builder
-
build
Builds a newOAuth2AccessTokenResponse.- Returns:
- a
OAuth2AccessTokenResponse
-