MCPcopy
hub / github.com/golang-jwt/jwt / WithAllAudiences

Function WithAllAudiences

parser_option.go:99–104  ·  view source on GitHub ↗

WithAllAudiences configures the validator to require all the specified audiences in the `aud` claim. Validation will fail if the specified audiences are not listed in the token or the `aud` claim is missing. Duplicates within the list are de-duplicated since internally, we use a map to look up the a

(aud ...string)

Source from the content-addressed store, hash-verified

97// writing secure application, we decided to REQUIRE the existence of the claim,
98// if an audience is expected.
99func WithAllAudiences(aud ...string) ParserOption {
100 return func(p *Parser) {
101 p.validator.expectedAud = aud
102 p.validator.expectAllAud = true
103 }
104}
105
106// WithIssuer configures the validator to require the specified issuer in the
107// `iss` claim. Validation will fail if a different issuer is specified in the

Callers 1

TestVerifyAudFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestVerifyAudFunction · 0.68