Skip to content

JWT access tokens: scope vs scp claim #3524

@brett-patterson

Description

@brett-patterson

Preflight checklist

Describe your problem

When using the JWT access token strategy, the scopes are encoded in the scp claim as an array of strings. From what I've read (see this RFC), it seems like the more standard way to do this is in the scope claim as a single space-delimited string.

Describe your ideal solution

It does look like the underlying fosite library supports this via the JWTScopeFieldProvider, but Hydra explicitly chooses JWTScopeFieldList. My preferred solution would be a configuration option for Hydra to allow us to opt in to the other scope claim behaviors supported by fosite. This can default to the current scp array strategy for backwards compatibility.

Workarounds or alternatives

It's fairly simple to have any scope checks look at the scp claim, but it makes it harder to use popular libraries like https://www.npmjs.com/package/express-oauth2-jwt-bearer which adhere pretty strictly to the standard scope claim.

Version

2.1.0

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or request.staleFeedback from one or more authors is required to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions