WithAudience configures the validator to require any of the specified audiences in the `aud` claim. Validation will fail if the audience is not listed in the token or the `aud` claim is missing. NOTE: While the `aud` claim is OPTIONAL in a JWT, the handling of it is application-specific. Since this
(aud ...string)
| 81 | // writing secure application, we decided to REQUIRE the existence of the claim, |
| 82 | // if an audience is expected. |
| 83 | func WithAudience(aud ...string) ParserOption { |
| 84 | return func(p *Parser) { |
| 85 | p.validator.expectedAud = aud |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | // WithAllAudiences configures the validator to require all the specified |
| 90 | // audiences in the `aud` claim. Validation will fail if the specified audiences |
no outgoing calls