JohnJ
Convex Community2y ago
404 replies
John

WorkOS Authkit as Custom Auth Integration with Convex

Currently having some trouble figuring out how to use WorkOS Authkit as Custom Auth with Convex.

- there doesn't seem to be an equivalent of an AuthProviderXReactProvider
- not sure how to update the useAuthFromProviderX reference to use with ConvexProviderWithAuth so that ctx.auth.getUserIdentity() works correctly
- not sure what to provide as the domain and applicationID in the auth.config.js file

I've tried referencing this next-authkit-example, the convex clerk example, and the nextauth example by Web Dev Cody, but still not sure how to get it working with convex.

The WorkOS docs mention that:

In order to persist the authenticated state of the user in the application, we need to store and access a session. WorkOS User Management does not currently offer a session management feature, this must instead be handled by the application.

For illustration purposes we’ll be using a JSON Web Token (JWT) to store the authenticated user in a short lived cookie, though your approach may differ depending on the application's specific requirements.

Which seems to refer to this file in their example. Not sure if that affects the setup for Convex.
Easy to use authentication APIs designed to provide a flexible, secure, and fast integration.
User Management – WorkOS Docs
Convex can be integrated with any identity provider supporting the
Custom Auth Integration | Convex Developer Hub
Easy to use authentication APIs designed to provide a flexible, secure, and fast integration.
User Management – WorkOS Docs
GitHub
Example application demonstrating how to authenticate users with AuthKit and the WorkOS Node SDK. - workos/next-authkit-example
next-authkit-example/src/app/callback/route.ts at main · workos/nex...
Was this page helpful?