Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix: add a trailing slash to jwt audiences
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Apr 7, 2022
1 parent 0c0e28c commit e96f78a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/app/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,20 @@ func NewMultiValidator(providers []AuthConfig) (MultiValidator, error) {
}
algorithm := validator.SignatureAlgorithm(alg)

// add a trailing slash (auth0-spa-js adds a trailing slash to audiences)
aud := append([]string{}, p.AUD...)
for i, a := range aud {
if !strings.HasSuffix(a, "/") {
a += "/"
}
aud[i] = a
}

v, err := validator.New(
provider.KeyFunc,
algorithm,
issuerURL.String(),
p.AUD,
aud,
validator.WithCustomClaims(func() validator.CustomClaims {
return &customClaims{}
}),
Expand Down

0 comments on commit e96f78a

Please sign in to comment.