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

allow multiple audiences #426

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

Conversation

gruberlu
Copy link

Hey there!

This change allows for multiple allowed audiences when verifying a JWT (see #342 ).

I did not implement the suggested function signature func WithAudiences(auds []string, matchAll bool) ParserOption {} as this would either cause breaking changes or lead to confusion and unnecessary complexity as a separate option.

@oxisto
Copy link
Collaborator

oxisto commented Dec 24, 2024

Hey there!

This change allows for multiple allowed audiences when verifying a JWT (see #342 ).

I did not implement the suggested function signature func WithAudiences(auds []string, matchAll bool) ParserOption {} as this would either cause breaking changes or lead to confusion and unnecessary complexity as a separate option.

Can you elaborate how this would be a breaking change?

@gruberlu
Copy link
Author

You would either have two functions then (WithAudience and WithAudiences) which does not cause a breaking change but is a little confusing in my opinion or just have the new function WithAudiences which does break existing code.

// WithAudience configures the validator to require the specified audience in
// the `aud` claim. Validation will fail if the audience is not listed in the
// token or the `aud` claim is missing.
// WithAudience configures the validator to require ONE of the specified

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A matchAll option would be useful here for users who want to ensure ALL audiences are present.
#342 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe #427 does just that, likely the implementation we'll go with.

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.

4 participants