fix(auth): accept the RFC 8037 EdDSA alg for OKP keys - #2060
Open
jclab-joseph wants to merge 2 commits into
Open
fix(auth): accept the RFC 8037 EdDSA alg for OKP keys#2060jclab-joseph wants to merge 2 commits into
jclab-joseph wants to merge 2 commits into
Conversation
JWT verification only recognised the JOSE spelling of the Ed algorithms,
where the signer is named after the curve ("Ed25519"/"Ed448"). RFC 8037
instead fixes `alg` to "EdDSA" and carries the curve in the JWK, which is
what conformant libraries emit — jose (JS), go-jose, python-jose and the
Supabase storage API all sign and verify Ed25519 tokens that way. Such a
token failed with :error_generating_signer even though its key was in the
tenant's JWKS.
The EdDSA spelling now resolves the signer from the JWK's curve, and an
OKP key with an unsupported curve still fails cleanly.
jclab-joseph
force-pushed
the
feat/accept-rfc8037-eddsa-alg
branch
from
July 30, 2026 23:32
472d946 to
88ac106
Compare
edgurgel
reviewed
Jul 31, 2026
…and add a wrong signature test)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix.
This PR fixes JWT verification for EdDSA tokens signed with Ed25519 or Ed448 keys.
What is the current behavior?
JWT verification only recognizes the JOSE algorithm names that identify the curve directly, such as
Ed25519andEd448.However, RFC 8037 specifies
algasEdDSA, with the specific curve provided by the JWK'scrvfield. Conformant libraries and services—including jose for JavaScript, go-jose, python-jose, and the Supabase Storage API—emit Ed25519 tokens using this format.As a result, a valid Ed25519 token with
alg: "EdDSA"fails verification with:error_generating_signer, even when the matching key is present in the tenant's JWKS.What is the new behavior?
JWT verification now recognizes the
EdDSAalgorithm and resolves the appropriate signer using the JWK'scrvvalue.For example:
alg: "EdDSA"withcrv: "Ed25519"resolves to the Ed25519 signer.alg: "EdDSA"withcrv: "Ed448"resolves to the Ed448 signer.This allows standards-compliant EdDSA tokens produced by commonly used JOSE libraries and the Supabase Storage API to be verified successfully.
Additional context
RFC 8037 separates the signing algorithm from the selected Edwards curve:
alg: "EdDSA".crvfield.This change preserves support for the existing curve-specific spellings while adding support for the RFC-compliant EdDSA representation.