added eager alg error check to minimize misuse
This commit is contained in:
@@ -114,12 +114,12 @@ func Fetch(ctx context.Context, jwksURL string, kid string) (*JWK, error) {
|
||||
}
|
||||
|
||||
for _, key := range jwks.Keys {
|
||||
if key.Kid == kid {
|
||||
if key.Kid == kid && key.Alg != "" {
|
||||
return key, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("JWK with kid %q was not found", kid)
|
||||
return nil, fmt.Errorf("missing JWK with kid %q and non-empty alg", kid)
|
||||
}
|
||||
|
||||
// ValidateTokenSignature validates the signature of a token with the
|
||||
|
||||
Reference in New Issue
Block a user