auth icon indicating copy to clipboard operation
auth copied to clipboard

fix: support ES256K OIDC token verification

Open Xavrir opened this issue 6 months ago • 2 comments

What changed

  • Add a narrow ES256K/secp256k1 verifier path for OIDC ID tokens.
  • Keep the existing go-oidc/go-jose verification path unchanged for non-ES256K providers.
  • Verify ES256K access token hashes with the SHA-256 at_hash calculation.
  • Require provider metadata to advertise ES256K unless it is explicitly allowed through SupportedSigningAlgs.
  • Add focused tests for valid ES256K tokens, bad signatures, unknown kid values, invalid curve points, missing algorithm metadata, and invalid at_hash values.

Fixes #2534

Testing

  • go test ./internal/api/provider -count=1
  • go test ./internal/api/... -run 'Test(ParseIDTokenES256K|ES256KRemoteKeySet)' -count=1
  • git diff --check

I also attempted the broader local make test path against a temporary Postgres test database. It ran most packages but failed in internal/mailer/validateclient TestValidateEmailExtended because a DNS-dependent invalid-host assertion returned nil locally; that failure is unrelated to this OIDC provider change.

Xavrir avatar May 27 '26 08:05 Xavrir

🚀 Preview Release Status

false


Last updated: 2026-01-23T11:11:06Z

github-actions[bot] avatar Jan 23 '26 11:01 github-actions[bot]

🚀 Preview Release Status

false


Last updated: 2026-01-23T11:11:05Z

github-actions[bot] avatar Jan 23 '26 11:01 github-actions[bot]