simplify KeyProvider interface

This commit is contained in:
Livio Amstutz 2021-06-30 14:10:38 +02:00
parent 0b446618c7
commit 58e27e8073
3 changed files with 9 additions and 9 deletions

View file

@ -122,13 +122,10 @@ type jwtProfileKeySet struct {
//VerifySignature implements oidc.KeySet by getting the public key from Storage implementation
func (k *jwtProfileKeySet) VerifySignature(ctx context.Context, jws *jose.JSONWebSignature) (payload []byte, err error) {
keyID, alg := oidc.GetKeyIDAndAlg(jws)
keyID, _ := oidc.GetKeyIDAndAlg(jws)
key, err := k.storage.GetKeyByIDAndUserID(ctx, keyID, k.userID)
if err != nil {
return nil, fmt.Errorf("error fetching keys: %w", err)
}
if key.Algorithm != alg {
}
return jws.Verify(&key)
return jws.Verify(key)
}