Skip to content

Cannot request access token for client with CLIENT_SECRET_BASIC #346

@jrmcdonald

Description

@jrmcdonald

Describe the bug
The ClientSecretBasicAuthenticationConverter#L89 uses the deprecated ClientAuthenticationMethod.BASIC. This means that if you have a registered client with the ClientAuthenticationMethod.CLIENT_SECRET_BASIC, you cannot request an access token as the check in OAuth2ClientAuthenticationProvider.java#L103 fails.

To Reproduce

  1. Run the sample authorization server in this repository
  2. Request an access token:
curl --location --request POST 'http://localhost:9000/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic bWVzc2FnaW5nLWNsaWVudDpzZWNyZXQ=' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=message.read'
  1. Observe successful response
  2. Modify the registered client authentication method to ClientAuthenticationMethod.CLIENT_SECRET_BASIC
  3. Repeat the above request
  4. Observe 401 response

Expected behavior
Response should be 200 with a valid access token.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions