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.Constructor and Description |
---|
DefaultAuthorizationCodeTokenResponseClient() |
Modifier and Type | Method and Description |
---|---|
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 OAuth2AccessTokenResponse getTokenResponse(OAuth2AuthorizationCodeGrantRequest authorizationCodeGrantRequest)
OAuth2AccessTokenResponseClient
getTokenResponse
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
OAuth2AccessTokenResponseHttpMessageConverter
ResponseErrorHandler
- OAuth2ErrorResponseErrorHandler
restOperations
- the RestOperations
used when requesting the Access
Token Response