Skip to content

Commit

Permalink
Bearer middleware: add "infer algorithm from key"
Browse files Browse the repository at this point in the history
Fixes (maybe) #3025, as the JWKS from Azure AD is known for omitting the `alg` property

Signed-off-by: ItalyPaleAle <[email protected]>
  • Loading branch information
ItalyPaleAle committed Aug 2, 2023
1 parent 60322a1 commit 1f0aad5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/http/bearer/bearer_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (m *Middleware) GetHandler(ctx context.Context, metadata middleware.Metadat
_, err = jwt.Parse([]byte(rawToken),
jwt.WithContext(r.Context()),
jwt.WithAcceptableSkew(allowedClockSkew),
jwt.WithKeySet(keyset),
jwt.WithKeySet(keyset, jws.WithInferAlgorithmFromKey(true)),

Check failure on line 115 in middleware/http/bearer/bearer_middleware.go

View workflow job for this annotation

GitHub Actions / Build linux_amd64 binaries

undefined: jws (typecheck)
jwt.WithAudience(meta.Audience),
jwt.WithIssuer(meta.Issuer),
)
Expand Down

0 comments on commit 1f0aad5

Please sign in to comment.