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
id_token iss claim doesn't match AS metadata issuer (Clerk/better-auth integration) #101
Decode the id_token from a real token-exchange response and iss is https://clerk.onkernel.com, not https://mcp.onkernel.com. RFC 8414 §3 requires the two to match; strict clients enforce.
Context
We hit this while onboarding kernel/ onto Smithery. The flow is past DCR (after working around a separate 200-vs-201 issue at /register client-side) and dies during token exchange in oauth4webapi's processAuthorizationCodeResponse. Same family from another client: jlowin/fastmcp#2453, open, no fix.
Fix options
Option
Where it lives
Tradeoff
1. Clerk JWT template that mints session tokens with iss=https://mcp.onkernel.com, used when minting through your /token route
Clerk dashboard + src/app/token/route.ts
Self-contained, no re-signing. Doesn't change AS identity.
2. Re-sign the id_token in src/app/token/route.ts with iss=https://mcp.onkernel.com before returning
src/app/token/route.ts
Full control over claims. Need a signing key, JWKs endpoint you own, and to update jwks_uri in your AS metadata.
3. Change AS metadata issuer to https://clerk.onkernel.com so it matches what's in the token
Activity