jsonwebtoken
jsonwebtoken copied to clipboard
Feature Request: Validate scopes
A common use-case, that currently requires custom code, is checking whether the token contains a specified scope. It would be great if scope checking could be added to the Validation.
Do you have an example of what your scope checking looks like?
scope isn't a standardized claim for JWTs per RFC 7519. It is standardized for OAuth 2.0 Token Exchange in RFC 8693, but jsonwebtoken is not an OAuth library. This seems like something better left to an OAuth 2.0 library built on top of jsonwebtoken.
Great point, for some reasons I thought it was in the JWT spec.