-
Notifications
You must be signed in to change notification settings - Fork 352
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
Verifying multiple audiences #342
Comments
Just to double-check: Are you sure you want to check against multiple expected audiences? What If there is a valid use case for it, I suppose we (or rather you ;) as part of a PR) could add the We tried to do the most basic functionality first in |
@oxisto Would you still be open to accepting a PR for this feature?
Perhaps the option could be configurable in this sense, e.g.
|
Having multiple audiences is beneficial when using Google OAuth, especially since we have different apps across web and mobile, each with its client ID (audience). The server endpoint needs to validate against these multiple audiences. Source: https://developers.google.com/identity/gsi/web/guides/verify-google-id-token
|
Ok, this could make sense. I would be open for a PR implementing this. |
Would we extend the existing parameter to be a variaadic, or add another functional option? |
I think the best way would be the approach suggested before: |
Hi there,
I've just updated to
v5
and found that the newRegisteredClaims
(inregistered_claims.go
) struct allows for a[]string
type via theClaimStrings
type. This opens the way for verifying multiple audiences from the token.I'm very happy with this, as my authentication provider does provide multiple audiences and
v4
gave no option to verify these.However, the new
ParserOption
namedWithAudience(aud string)
and accompanyingvalidator
still only allows for a singlestring
audience to be verified.With RFC 7519 specifically mentioning multiple audiences, it does feel like something nice to support.
My questions are as follows:
ParserOption
calledWithAudiences(auds []string)
for the specific case of multiple audiences. This would not break the existingWithAudience(..)
and add functionality.Thanks in advance!
The text was updated successfully, but these errors were encountered: