Skip to content

Cannot request access token for client with CLIENT_SECRET_BASIC #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jrmcdonald opened this issue Jul 13, 2021 · 3 comments
Closed

Cannot request access token for client with CLIENT_SECRET_BASIC #346

jrmcdonald opened this issue Jul 13, 2021 · 3 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@jrmcdonald
Copy link

jrmcdonald commented Jul 13, 2021

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.

@sjohnr
Copy link
Contributor

sjohnr commented Jul 16, 2021

@jrmcdonald, thanks for the bug report! As you can see, a community member is already working on this.

bibibiu2017 added a commit to bibibiu2017/spring-authorization-server that referenced this issue Jul 17, 2021
bibibiu2017 added a commit to bibibiu2017/spring-authorization-server that referenced this issue Jul 17, 2021
bibibiu2017 added a commit to bibibiu2017/spring-authorization-server that referenced this issue Jul 17, 2021
bibibiu2017 added a commit to bibibiu2017/spring-authorization-server that referenced this issue Jul 17, 2021
@jrmcdonald
Copy link
Author

Hi @sjohnr, thanks for that, do you know which milestone this is likely to be included in?

@jgrandja jgrandja self-assigned this Jul 20, 2021
@jgrandja jgrandja added this to the 0.2.0 milestone Jul 20, 2021
@jgrandja
Copy link
Collaborator

@jrmcdonald This is now merged and ready for 0.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants