Class OAuth2ClientCredentialsAccessTokenResponseClient

java.lang.Object
com.broadleafcommerce.pricing.oauth2.client.OAuth2ClientCredentialsAccessTokenResponseClient
All Implemented Interfaces:
org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient<org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest>

@Deprecated(since="Pricing Service 2.0.8, 2.1.3, 2.2.1", forRemoval=true) public class OAuth2ClientCredentialsAccessTokenResponseClient extends Object implements org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient<org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest>
Deprecated, for removal: This API element is subject to removal in a future version.
Use CommonOAuth2ClientCredentialsAccessTokenResponseClient instead
Alternative to the default RestTemplate-based token response client that uses WebClient and 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 relies on OAuth2AccessTokenResponseHttpMessageConverter which restricts the access token response to a Map where the value type is String instead of Object. This implementation properly allows non-String properties within the access token response.

Since RestTemplate is expected to be later deprecated, this implementation utilizes a WebClient instead 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)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse
    getTokenResponse(org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OAuth2ClientCredentialsAccessTokenResponseClient

      public OAuth2ClientCredentialsAccessTokenResponseClient(org.springframework.web.reactive.function.client.WebClient webClient)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getTokenResponse

      public org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse getTokenResponse(org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getTokenResponse in interface org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient<org.springframework.security.oauth2.client.endpoint.OAuth2ClientCredentialsGrantRequest>