Class DefaultOAuth2TokenRequestHeadersConverter<T extends AbstractOAuth2AuthorizationGrantRequest>

java.lang.Object
org.springframework.security.oauth2.client.endpoint.DefaultOAuth2TokenRequestHeadersConverter<T>
All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<T,org.springframework.http.HttpHeaders>

public final class DefaultOAuth2TokenRequestHeadersConverter<T extends AbstractOAuth2AuthorizationGrantRequest> extends Object implements org.springframework.core.convert.converter.Converter<T,org.springframework.http.HttpHeaders>
Default Converter used to convert an AbstractOAuth2AuthorizationGrantRequest to the HttpHeaders of a RequestEntity representation of an OAuth 2.0 Access Token Request for the specific Authorization Grant.
Since:
6.3
See Also:
  • AbstractOAuth2AuthorizationGrantRequestEntityConverter
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.HttpHeaders
    convert(T grantRequest)
    Populates the default headers for the token request.
    void
    setEncodeClientCredentials(boolean encodeClientCredentials)
    Sets whether the client credentials of the Authorization header will be encoded using the application/x-www-form-urlencoded encoding algorithm according to RFC 6749.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.core.convert.converter.Converter

    andThen
  • Constructor Details

    • DefaultOAuth2TokenRequestHeadersConverter

      public DefaultOAuth2TokenRequestHeadersConverter()
  • Method Details

    • convert

      public org.springframework.http.HttpHeaders convert(T grantRequest)
      Populates the default headers for the token request.
      Specified by:
      convert in interface org.springframework.core.convert.converter.Converter<T extends AbstractOAuth2AuthorizationGrantRequest,org.springframework.http.HttpHeaders>
      Parameters:
      grantRequest - the authorization grant request
      Returns:
      the headers populated for the token request
    • setEncodeClientCredentials

      public void setEncodeClientCredentials(boolean encodeClientCredentials)
      Sets whether the client credentials of the Authorization header will be encoded using the application/x-www-form-urlencoded encoding algorithm according to RFC 6749. Default is true.
      Parameters:
      encodeClientCredentials - whether the client credentials will be encoded
      See Also: