sbkl.
sbkl.9mo ago

AuthKit from WorkOS integration

Tried to integrate custom Auth with AuthKit from WorkOS but realised the access token they provide lack of the “aud” field which is what convex auth config need for its applicationID field. Or am I missing something? If anyone could point me in the right direction or was able to pull it off, please let me know!
9 Replies
Michal Srb
Michal Srb9mo ago
You might be able to use https://stack.convex.dev/nextauth with WorkOS provider?
Convex with Auth.js (NextAuth)
Learn how to use Auth.js with your Next.js server and Convex backend to build a full-featured authentication system.
sbkl
sbkl9mo ago
@Michal Srb Thank you. Reviewed next-auth but I need auth for both nextjs and expo. next-auth doesn't provide native support from what I understand. Asked workOS if they planned to provide custom fields on their access_token which doesn't seem to be the case at this time.
Cam
Cam9mo ago
I'm in a similar boat. I need auth for mobile and web. Clerk was easy to set up, and works well with convex. But I doubt i'll generate much revenue, so I am experimenting with Lucia auth, so far so good.
sbkl
sbkl9mo ago
The reason I want AuthKit is the easy integration with WorkOS enabling SSO which a requirement for most of my clients. Clerk provides it somehow but seems way more work to setup and I'm familiar with workOS. But will explore further with Clerk.
Matt Luo
Matt Luo8mo ago
Hi @sbkl - were you ever able to get workOS to work? Was the lack of aud (audience) field the only blocker that stopped you?
sbkl.
sbkl.OP8mo ago
I couldn’t investigate further because of the missing aud claim from authkit. If web only, Auth.js should make the job. Supabase auth for both react and react native could be an alternative but I didn’t look into it.
Matt Luo
Matt Luo8mo ago
Hi @Michal Srb , are there any plans to make it easier to integrate Convex with WorkOS/AuthKit for a tech stack with Next.js and React Native? I think WorkOS is a better fit for my app than Clerk is, but I use Clerk since there is a lot of documentation for Convex and Clerk
Michal Srb
Michal Srb8mo ago
I can't make any promises, but the auth-running-on-your-backend lib should enable this (but server-side Next.js support is TBD). Eventually it would be nice to have WorkOS integration on par with Clerk, but I haven't looked into it yet.
Matt Luo
Matt Luo8mo ago
I Googled "auth-running-on-your-backend lib" and didn't find anything, so I'm assuming you're referring to the upcoming Convex native auth

Did you find this page helpful?