Skip to content

Propagate the signature verification errors correctly while verifying token signature #864

@grvijayan

Description

@grvijayan

Preflight Checklist

  • I could not find a solution in the existing issues, docs, nor discussions
  • I have joined the ZITADEL chat

Describe your problem

Follow up for: zitadel/zitadel#11924
The error returned after the signature verification fails is not propagated correctly to the calling function.

oidc/pkg/oidc/verifier.go

Lines 193 to 196 in cab66d5

signedPayload, err := set.VerifySignature(ctx, jws)
if err != nil {
return fmt.Errorf("%w (%v)", ErrSignatureInvalid, err)
}

Describe your ideal solution

The error is wrapped (using the %w verb) instead of embedding (with the %v verb) the error message before returning to the caller.

Version

No response

Environment

ZITADEL Cloud

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions