#auth
1 messages · Page 1 of 1 (latest)
Hi @mild swan. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Convex can integrate with various authentication providers, including Supabase Auth, but there are important caveats and limitations to be aware of—especially for Expo (React Native) mobile apps.
Supabase Auth with Convex: What’s Possible?
Convex supports authentication via OpenID Connect (OIDC) compatible providers, which includes many third-party auth systems. In theory, if Supabase Auth exposes OIDC endpoints and provides JWTs, you can configure Convex to accept those tokens for authentication. This involves setting up your auth.config.ts in Convex with the correct domain (matching the iss claim in the JWT) and applicationId (matching the aud claim) from Supabase. You would then pass the Supabase access token to Convex in your app’s authentication flow.
However, there are some practical challenges:
- Supabase OIDC Support: There are reports that Supabase does not fully implement OIDC, as it may not expose the required well-known endpoints. This can make integration with Convex more difficult or even impossible without custom workarounds. If Supabase does not provide a JWKS endpoint or the necessary OIDC metadata, Convex cannot verify the tokens out of the box. In such cases, you might need to use the
customJwtprovider type and manually configure the JWT verification, if possible. But this is not a standard or well-documented path and may require significant effort and troubleshooting. See discussion
-
Community Experience: Some developers have tried to set up Supabase Auth with Convex for React Native/Expo apps, but have run into issues such as "Not authenticated" errors, even when the Supabase access token is available in the app. This suggests that the integration is not straightforward and may not be fully supported at this time. See example thread
-
Convex Team Recommendation: The Convex team generally recommends using Convex Auth (their own solution) or third-party providers like Clerk or Auth0, which have better support and documentation for Convex integration, especially for React Native/Expo environments. Convex Auth is designed to work directly with Convex and is used successfully in Expo apps, supporting OTP, OAuth, and password-based flows. See Convex Auth docs and Discord support
Summary
- Supabase Auth integration with Convex is theoretically possible if Supabase provides full OIDC support, but in practice, it is often problematic due to missing endpoints and incomplete compatibility.
- Convex Auth or Clerk are recommended for Expo/React Native apps, as they are better supported and documented for use with Convex.
- If you want to proceed with Supabase Auth, be prepared for potential roadblocks and custom configuration, and check the latest community discussions for updates or workarounds.
If you need a smoother experience and tighter integration, Convex Auth is likely your best option for authentication in a Convex + Expo mobile app setup.
If you have specific requirements or want to see example code for Convex Auth in Expo, let me know!
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@mild swan Kapa.ai is still learning and improving, please let me know how I did by reacting below.
what about using firebase auth?
@ancient zealot
Let me check the knowledge base for you again. One moment! :books:
Using Firebase Auth directly with Convex Auth is not officially supported. According to a response from Convex support, integrating Firebase Auth with Convex Auth is not something that is currently supported. The recommendation is to use another authentication provider, such as Clerk, which may be able to work with Firebase Auth, or to use Convex Auth or another supported provider directly. You do not have to use Convex Auth to use Convex, but Convex Auth is just one option among several for authentication in Convex apps Firebase Auth (Native iOS) + Convex auth.