public final class DefaultPasswordTokenResponseClient extends java.lang.Object implements OAuth2AccessTokenResponseClient<OAuth2PasswordGrantRequest>
OAuth2AccessTokenResponseClient
for the password grant.
This implementation uses a RestOperations when requesting
an access token credential at the Authorization Server's Token Endpoint.OAuth2AccessTokenResponseClient,
OAuth2PasswordGrantRequest,
OAuth2AccessTokenResponse,
Section 4.3.2 Access Token Request (Resource Owner Password Credentials Grant),
Section 4.3.3 Access Token Response (Resource Owner Password Credentials Grant)| Constructor and Description |
|---|
DefaultPasswordTokenResponseClient() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse |
getTokenResponse(OAuth2PasswordGrantRequest passwordGrantRequest)
Exchanges the authorization grant credential, provided in the authorization grant request,
for an access token credential at the Authorization Server's Token Endpoint.
|
void |
setRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2PasswordGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Sets the
Converter used for converting the OAuth2PasswordGrantRequest
to a RequestEntity representation of the OAuth 2.0 Access Token Request. |
void |
setRestOperations(org.springframework.web.client.RestOperations restOperations)
Sets the
RestOperations used when requesting the OAuth 2.0 Access Token Response. |
public org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse getTokenResponse(OAuth2PasswordGrantRequest passwordGrantRequest)
OAuth2AccessTokenResponseClientgetTokenResponse in interface OAuth2AccessTokenResponseClient<OAuth2PasswordGrantRequest>passwordGrantRequest - the authorization grant request that contains the authorization grant credentialOAuth2AccessTokenResponse that contains the access token credentialpublic void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2PasswordGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Converter used for converting the OAuth2PasswordGrantRequest
to a RequestEntity representation of the OAuth 2.0 Access Token Request.requestEntityConverter - the Converter used for converting to a RequestEntity representation of the Access Token Requestpublic void setRestOperations(org.springframework.web.client.RestOperations restOperations)
RestOperations used when requesting the OAuth 2.0 Access Token Response.
NOTE: At a minimum, the supplied restOperations must be configured with the following:
HttpMessageConverter's - FormHttpMessageConverter and OAuth2AccessTokenResponseHttpMessageConverterResponseErrorHandler - OAuth2ErrorResponseErrorHandlerrestOperations - the RestOperations used when requesting the Access Token Response