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

feat: set api url from jwt audience claim #258

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cmars
Copy link
Contributor

@cmars cmars commented Oct 7, 2024

Snyk's OAuth implementation is capable of indicating the environment which the user is authenticated into and authorized to access.

This is specified in the audience JWT claim ("aud"). Snyk's implementation of this claim contains an array of strings, per RFC 7519.

If set and non-empty, the first audience URL is taken as the default API URL that the client should use, unless the endpoint was specifically configured.


  • TODO: validate w/IDE team
  • TODO: validate w/auth folks, work out env switching rabbit holes

@cmars cmars force-pushed the feat/set-api-url-jwt-claim-aud branch from 8bdc0ae to bcdde41 Compare October 7, 2024 19:20
@cmars cmars force-pushed the feat/set-api-url-jwt-claim-aud branch 3 times, most recently from 5f18602 to 869131b Compare October 8, 2024 16:27
@PeterSchafer
Copy link
Contributor

Very Nice!!!

@cmars cmars force-pushed the feat/set-api-url-jwt-claim-aud branch 2 times, most recently from 562545c to f377430 Compare October 8, 2024 17:34
Snyk's OAuth implementation is capable of indicating the environment
which the user is authenticated into and authorized to access.

This is specified in the audience JWT claim ("aud"). Snyk's
implementation of this claim contains an array of strings, per RFC 7519.

If set and non-empty, the first audience URL is taken as the default API
URL that the client should use, unless the endpoint was specifically
configured.
It's a test JWT created on jwt.io for testing the parsing of claims
and cannot be used as a valid authorization anywhere.
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