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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.HttpHeadersPopulates the default headers for the token request.voidsetEncodeClientCredentials(boolean encodeClientCredentials) Sets whether the client credentials of theAuthorizationheader will be encoded using theapplication/x-www-form-urlencodedencoding algorithm according to RFC 6749.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
convertin 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 theAuthorizationheader will be encoded using theapplication/x-www-form-urlencodedencoding algorithm according to RFC 6749. Default istrue.- Parameters:
encodeClientCredentials- whether the client credentials will be encoded- See Also:
-