public final class DefaultClientCredentialsTokenResponseClient extends java.lang.Object implements OAuth2AccessTokenResponseClient<OAuth2ClientCredentialsGrantRequest>
OAuth2AccessTokenResponseClient
for the
client_credentials
grant. This
implementation uses a RestOperations
when requesting an access token credential
at the Authorization Server's Token Endpoint.Constructor and Description |
---|
DefaultClientCredentialsTokenResponseClient() |
Modifier and Type | Method and Description |
---|---|
OAuth2AccessTokenResponse |
getTokenResponse(OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest)
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<OAuth2ClientCredentialsGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Sets the
Converter used for converting the
OAuth2ClientCredentialsGrantRequest 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 DefaultClientCredentialsTokenResponseClient()
public OAuth2AccessTokenResponse getTokenResponse(OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest)
OAuth2AccessTokenResponseClient
getTokenResponse
in interface OAuth2AccessTokenResponseClient<OAuth2ClientCredentialsGrantRequest>
clientCredentialsGrantRequest
- the authorization grant request that contains the
authorization grant credentialOAuth2AccessTokenResponse
that contains the
access token
credentialpublic void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2ClientCredentialsGrantRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Converter
used for converting the
OAuth2ClientCredentialsGrantRequest
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