You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Embedded auth server signs with an Ed25519 key, but ToolHive's token validator refuses EdDSA tokens #7250
The embedded authorization server accepts an Ed25519 signing key and signs
its access tokens with EdDSA. ToolHive's token validator, which the vMCP and
proxy use to check those tokens, accepts only RSA and ECDSA signatures. So a
server configured with an Ed25519 key starts without an error, and then every
token it issues is refused with a 401. Nothing points at the key type.
Line numbers below are from v0.66.0.
pkg/authserver/server/keys/provider.go:58: NewFileProvider loads RSA,
ECDSA, and Ed25519 PEM keys.
pkg/authserver/server/crypto/keys.go:128: DeriveAlgorithm returns EdDSA for an ed25519.PrivateKey, so tokens are signed with EdDSA.
pkg/auth/token.go:899: validateTokenHeader allows only *jwt.SigningMethodRSA and *jwt.SigningMethodECDSA, and refuses anything
else with unexpected signing method.
This happens on the in-process path too, where the validator gets the auth
server's own keys through WithKeyProvider (pkg/auth/token.go:594, pkg/vmcp/auth/factory/incoming.go:242). The key is found; the signing
method is refused before the signature is checked.
How to reproduce
Generate an Ed25519 key: openssl genpkey -algorithm ed25519 -out as.pem.
Run the embedded auth server with signing_key_config.signing_key_file
set to as.pem, behind a vMCP that validates its tokens.
Complete a login and call the vMCP with the issued access token.
Expected: the call succeeds. Actual: 401. The validator refuses the token
with unexpected signing method: EdDSA.
Possible fixes
Accept EdDSA in validateTokenHeader (*jwt.SigningMethodEd25519). This
is only complete if every path that checks these tokens handles Ed25519
keys, including keys fetched from a remote JWKS (OKP keys) and the
discovery metadata.
Refuse an Ed25519 signing key in the embedded auth server, at key loading
or config validation, with an error that names the supported key types.
This matches the existing decision at pkg/authserver/server/crypto/keys.go:170-175, which leaves EdDSA out of
client key algorithms because fosite cannot verify it.
Option 2 is smaller and fails at startup instead of at the first request.
Option 1 makes the documented Ed25519 support real.
Activity
Accept EdDSA tokens in the token validator (stacklok#7253)