WebClientReactiveClientCredentialsTokenResponseClient should not set Authorization header when ClientAuthenticationMethod.POST #6911
Labels
in: oauth2
An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Summary
WebClientReactiveClientCredentialsTokenResponseClient
always sets anAuthorization
header for basic auth even if theClientAuthenticationMethod
isPOST
.Actual Behavior
Results in a request being made to the
tokenUri
withBasic XXXX
in theAuthorization
header.Expected Behavior
There should be no
Authorization
header set at all, the client id and client secret should only be in thePOST
body.Version
5.1.5.RELEASE
Looking at the code in
WebClientReactiveClientCredentialsTokenResponseClient
, it's obviously what the cause is:Looks like someone forgot to remove the first call to
headers.setBasicAuth()
when adding the check forClientAuthenticationMethod
==BASIC
...The text was updated successfully, but these errors were encountered: