entropy
entropy7mo ago

Implementing non OpenID custom auth

Hello, I have a website that requires dual auth provider sign ins for a valid session. Previous I would do this with supabase by using their JWT secret to sign my session cookie. This allowed supabase auth to work with my custom authenication system. I was wondering if there was a similar way to do this with Convex?
3 Replies
Michal Srb
Michal Srb7mo ago
Either: - Don't use ctx.auth, pass your secret/credential as an argument to your function and validate it directly in them - Do the self-signing trick, after validating credentials issue a JWT that has the Convex backend as the issuer. This is the approach the NextAuth example takes: https://stack.convex.dev/nextauth
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.
entropy
entropyOP7mo ago
Gotcha thanks for the info. The self signing trick looks interesting so I'll look into that.

Did you find this page helpful?