|
// 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. |
|
func WithSubject(sub string) 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?
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?