Skip to content

Commit da007de

Browse files
authored
auth/oidc: infer JWKS algorithm (#96)
1 parent 4718d3e commit da007de

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

rpc/auth/oidc/provider.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ func (p *AuthProvider) Verify(ctx context.Context, verifCtx *proto.VerificationC
107107
getKeySet: p.GetKeySet,
108108
}
109109

110-
if _, err := jws.Verify([]byte(answer), jws.WithKeySet(ks, jws.WithMultipleKeysPerKeyID(false))); err != nil {
110+
keySetOpts := []jws.WithKeySetSuboption{
111+
jws.WithMultipleKeysPerKeyID(false),
112+
jws.WithInferAlgorithmFromKey(true),
113+
}
114+
115+
if _, err := jws.Verify([]byte(answer), jws.WithKeySet(ks, keySetOpts...)); err != nil {
111116
return proto.Identity{}, fmt.Errorf("signature verification: %w", err)
112117
}
113118

0 commit comments

Comments
 (0)