Skip to content
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

Access Token Scope not meeting oAuth 2 specification requirements? #1260

Closed
cvigorsICBF opened this issue Jan 12, 2022 · 2 comments
Closed
Milestone

Comments

@cvigorsICBF
Copy link

Hi,
In the client credentials docs it has the scope included in the request, but only the token_type, expires_in and access_token is included in the response. The scope is not included in the response.

What happens if a client requests a scope that they are not allowed access too?

According to the oauth2 specification , it states that:
"If the issued access token scope is different from the one requested by the client, the authorization server MUST include the "scope" response parameter to inform the client of the actual scope granted."

For example

A client has been granted access to scope “scope1”, but requests “scope1 scope2”

{ "grant_type": "client_credentials", "client_id" : "test", "client_secret" : "test_secret", "scope" : "scope1 scope2" }
The server responds with the expected fields:
{ "token_type": "Bearer", "expires_in": 86400, "access_token": "eyJ0eXAiOiJ........" }

There is nothing in the response to indicate to the client what scopes the access_token can be used for.

Should the response actually be:
{ "token_type": "Bearer", "expires_in": 86400, "access_token": "eyJ0eXAiOiJ........", "scope": "scope1" }

@Sephster
Copy link
Member

Thanks for reporting. This does appear to not conform to the specs. Will flag this as a bug. Thanks for reporting

@Sephster Sephster added this to the 9.00 milestone Jan 24, 2022
@Sephster
Copy link
Member

Realised this is a duplicate of #793 so closing in favour of that. Thank you for reporting though @cvigorsICBF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants