Skip to content

Client Credentials broken in 5.0.0-rc.1 #217

Closed
@shrihari-prakash

Description

@shrihari-prakash

Specify your setup

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. In the token endpoint, supply grant type as client_credentials.
  2. Pass the access token from the previous step to a route that uses OAuthServer.server.authenticate.
  3. Result will be invalid_token: Invalid token: access token is invalid.

Alternatively, please add a link to a GitHub repo
that reproduces the error/s.

It is possible to do a quick check in a dev deployment of my project: https://liquid-pe2r.onrender.com (It is very slow on the first request, so give it a minute to load, and then do the API call).

  1. Send request to https://liquid-pe2r.onrender.com/oauth/token
  2. Sample client-credentials: client_id: application_client, client_secret: super-secure-client-secret
  3. Scope: system.client.all
  4. Now try to access http://localhost:2000/system/client-api/stats (Which can be accessed only by clients).

You should see an unauthorized.

Expected behavior

The server should accept the valid token.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

The problem seems to be due to a different token passed to getAccessToken function in the model than the one that was returned by authorize function..

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't workingbug resolved 😃Bug has been resolved and fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions