You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// WithSubject configures the validator to require the specified subject in the
// `sub` claim. Validation will fail if a different subject is specified in the
// token or the `sub` claim is missing.
//
// NOTE: While the `sub` claim is OPTIONAL in a JWT, the handling of it is
// application-specific. Since this validation API is helping developers in
// writing secure application, we decided to REQUIRE the existence of the claim,
// if a subject is expected.
funcWithSubject(substring) ParserOption {
Would it be possible to add a convenience validator method jwt.WithSubjects(subjects []string) that returns an error if the request's subject doesn't match any of the subjects?
The text was updated successfully, but these errors were encountered:
I'm curious about the use case for checking against multiple subjects, since typically you'd have a JWT representing claims about one specific subject. Delegation?
jwt/parser_option.go
Lines 97 to 105 in 5ec246c
Would it be possible to add a convenience validator method
jwt.WithSubjects(subjects []string)
that returns an error if the request's subject doesn't match any of thesubjects
?The text was updated successfully, but these errors were encountered: