scitokens / scitokens-go

Other
3 stars 1 forks source link

Need to be able to validate audience claim #4

Closed retzkek closed 2 years ago

retzkek commented 2 years ago

The Enforcer needs to be able to validate that it's the token audience. New Validator and Enforcer method:

func WithAudience(string) Validator

func (e *Enforcer) RequireAudience(string) error
retzkek commented 2 years ago

jwt has a WithAudience Validator, but it's just doing simple matching, while we need to be able to check for a specific aud OR one of the "wildcard" audiences - "ANY" for scitokens and "https://wlcg.cern.ch/jwt/v1/any" for WLCG tokens (these should be configurable).