Class OAuth2ClientCredentialsAccessTokenResponseClient
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.oauth2.client.endpoint.OAuth2ClientCredentialsAccessTokenResponseClient
-
- All Implemented Interfaces:
org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient<org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest>
public class OAuth2ClientCredentialsAccessTokenResponseClient extends Object implements org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient<org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest>
Alternative toDefaultClientCredentialsTokenResponseClientthat usesWebClientand allows for access token response that contain additional non-String parameters.This is necessary if the access token response contains any non-String properties, as the default implementation
DefaultClientCredentialsTokenResponseClientrelies onOAuth2AccessTokenResponseHttpMessageConverterwhich restricts the access token response to aMapwhere the value type isStringinstead ofObject. This implementation properly allows non-String properties within the access token response.Since
RestTemplateis expected to be later deprecated, this implementation utilizes aWebClientinstead for a more consistent experience.This implementation also takes a lot of inspiration from
WebClientReactiveClientCredentialsTokenResponseClient, which is the reactive version of this component. TODO: move this to a broadleaf oauth2 client dependency- Author:
- Nick Crum (ncrum)
-
-
Constructor Summary
Constructors Constructor Description OAuth2ClientCredentialsAccessTokenResponseClient(org.springframework.web.reactive.function.client.WebClient webClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponsegetTokenResponse(org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest)
-
-
-
Method Detail
-
getTokenResponse
public org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse getTokenResponse(org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest)
- Specified by:
getTokenResponsein interfaceorg.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient<org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest>
-
-