Repository navigation
feat: support keyless PKCE public clients - #96
Merged
Merged
Conversation
nicknisi
marked this pull request as ready for review
October 5, 2026 23:35
WORKOS_API_KEY is now optional. Without it, AuthKit builds the WorkOS client
with only a client ID and runs as a PKCE public client: code exchange and
refresh send no client_secret.
- AuthKitConfig is a union of AuthKitConfidentialConfig (apiKey) and
AuthKitPublicConfig (no apiKey); getConfig('apiKey') is string | undefined
- WorkOS is constructed with the options form, passing apiKey and clientId
- getFeatureFlagsRuntimeClient throws an actionable error without a key
- README documents public client mode and what needs a key
nicknisi
force-pushed
the
riker/55-let-workos-inc-authkit-react-router-run
branch
from
October 5, 2026 23:37
a3d4552 to
c080133
Compare
Contributor
|
Add a public-client spec case that loads a route with an expired, really signed access token: authkitLoader verifies it against the client's JWKS, refreshes without a client secret, and returns a replacement session cookie. Clarify in the README that withAuth does not refresh on its own.
cmatheson
approved these changes
Oct 6, 2026
This was referenced Oct 7, 2026
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.
Let @workos-inc/authkit-react-router run as a keyless PKCE public client: a server that only needs to sign users in works with WORKOS_CLIENT_ID, WORKOS_REDIRECT_URI and WORKOS_COOKIE_PASSWORD, with no WORKOS_API_KEY. Model the config as a discriminated union (confidential client with an apiKey vs public client without one), so TypeScript makes clear which features need a key. Then demonstrate it working end to end in the React Router example app (/Users/nicknisi/Developer/react-router-authkit-example) running against the local build with no API key, and hand Nick a running demo plus exact steps so he can sign in, see the session load, and see a token refresh succeed.
Riker's check
npm run typecheck && npm run lint && npm run prettier && npm test && npm run buildpassed.Opened as a draft by Riker (job 55).