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

fix: complies access scope validation to RFC8693 #4544

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nlepage
Copy link

@nlepage nlepage commented Feb 14, 2025

Problem

RFC8693 on OAuth2.0 Token Exchange specifies that credentials scope may contain a space-separated list of scopes, however hapi’s access scope only supports either a string containing a single scope or an array containing a list of scopes.

Proposal

Allow using a string containing a space-separated list of scopes.

scope validation should support space separated values in credentials
see https://datatracker.ietf.org/doc/html/rfc8693#name-scope-scopes-claim

Co-authored-by: Vincent Hardouin <[email protected]>
@kanongil
Copy link
Contributor

Thanks for the PR!

I have had a look at how Hapi handles scopes, and I don't agree that Hapi has an issue as such. The format of credentials.scope is defined by Hapi (though not explicitly), not any specific spec. It is the job of the auth strategy/scheme to convert to this format when needed. Expanding this interface should be done with great caution.

How are you applying it / what plugin are you using? If it provides a hook, you might be able to massage it in a callback.

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

Successfully merging this pull request may close these issues.

2 participants