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
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.HttpHeaders
Populates the default headers for the token request.void
setEncodeClientCredentials
(boolean encodeClientCredentials) Sets whether the client credentials of theAuthorization
header will be encoded using theapplication/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
Populates the default headers for the token request.- Specified by:
convert
in interfaceorg.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 theAuthorization
header will be encoded using theapplication/x-www-form-urlencoded
encoding algorithm according to RFC 6749. Default istrue
.- Parameters:
encodeClientCredentials
- whether the client credentials will be encoded- See Also:
-