public final class DefaultAuthorizationCodeTokenResponseClient extends java.lang.Object implements OAuth2AccessTokenResponseClient<OAuth2AuthorizationCodeGrantRequest>
OAuth2AccessTokenResponseClient for the
authorization_code grant. This
implementation uses a RestOperations when requesting an access token credential
at the Authorization Server's Token Endpoint.OAuth2AccessTokenResponseClient,
OAuth2AuthorizationCodeGrantRequest,
OAuth2AccessTokenResponse,
Section 4.1.3 Access Token Request
(Authorization Code Grant),
Section 4.1.4 Access Token Response
(Authorization Code Grant)| Constructor and Description |
|---|
DefaultAuthorizationCodeTokenResponseClient() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse |
getTokenResponse(OAuth2AuthorizationCodeGrantRequest authorizationCodeGrantRequest)
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<OAuth2AuthorizationCodeGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Sets the
Converter used for converting the
OAuth2AuthorizationCodeGrantRequest 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 DefaultAuthorizationCodeTokenResponseClient()
public org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse getTokenResponse(OAuth2AuthorizationCodeGrantRequest authorizationCodeGrantRequest)
OAuth2AccessTokenResponseClientgetTokenResponse in interface OAuth2AccessTokenResponseClient<OAuth2AuthorizationCodeGrantRequest>authorizationCodeGrantRequest - the authorization grant request that contains the
authorization grant credentialOAuth2AccessTokenResponse that contains the
access token credentialpublic void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2AuthorizationCodeGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Converter used for converting the
OAuth2AuthorizationCodeGrantRequest 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