Repository navigation
fix(backend): Accept RSA jwtKey of any size - #11107
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🦋 Changeset detectedLatest commit: 6e6af5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |


Summary
jwtKey/CLERK_JWT_KEYaccepts an RSA public key of any size, such as 3072-bit. ES256 support and the JWKS fallback from #11036 are unchanged.The prefix strip was a 2021 workaround for Next.js dev mode not parsing PEM keys.
importKeyhas imported PEM strings directly sincesignJwtlanded, sojwtKeynow goes through that path too.Evidence
jwtKeyderives the wrong modulus, so every token fails withtoken-invalid-signature.After:
verify.test.ts"verifies a token signed by a 3072-bit key" passes.\nor\r\nescapes, a PEM wrapped in double or single quotes, a bare base64 body and a base64url body all verify.jwtKeystill fails withtoken-invalid-signature, so the dev-mode handshake hint is unchanged.Merge Danger
Door: two-way
Blast Radius: verification
jwtKeyalso verifies RS384 and RS512 tokens signed by the same key, without fetching the JWKS.verifyJwtfrom@clerk/backend/jwtreports a PEM key that cannot be imported astoken-invalid-signature, which is what ajwtKeyalready gave. Before, a bad PEM string passed toverifyJwtgavetoken-verification-failed.hasValidSignaturenow returnsfalsefor it instead of throwing.