Configure Google OAuth with React native app. #1717
-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 19 replies
-
hey @mgazanayi what issues are you facing with setting this up? note that you can use the regular signIn with redirect method like: const { user, session, error } = await supabase.auth.signIn({
provider: 'google'
}, {
redirectTo: 'https://example.com/welcome' // this can also be a mobile deep link
}) you can add URLs (including mobile deep links) to the allow list in the dashboard in Auth > Settings > Additional Allowed URLs: |
Beta Was this translation helpful? Give feedback.
-
I have the same question. How do you implement authentitication with Google or Facebook in a React Native app? Are we supposed to render this page in React Native to keep with the process? And what about this library? It seems to be the most popular to do oAuth in React Native. |
Beta Was this translation helpful? Give feedback.
-
I'd appreciate it if anyone could elaborate a bit more on authentication in RN (with expo) using OAuth providers. The only offical doc I've seen it this:
The problem with this example is that doesn't work on react-native-web using NextJS. It tries to open an start page under http://localhost:3000?start?.... that it supposed to be an Expo proxy .... On the other hand, on Expo there's an example for Google OAuth:
Problem is that you cannot specify supabase authenticate server Finally I've found this issue regarding id_token workflow where it explain the id_token grant flow My question is how to link all this together (RN/RNW + Expo auth + supabase). What is the correct workflow? Expo auth methods authenticate against Google API and returns an id_token. How is it supposed to used it against supabase? @kangmingtay I'd appreciate any inputs! thx |
Beta Was this translation helpful? Give feedback.
-
I was set on using supabase as my prototyping - mvp phase backend, but after seeing how difficult it is to set up SSO with existing providers, i'm having second thoughts.. Firebase handles this with 0 fuss, was hoping supabase had a somewhat similar experience |
Beta Was this translation helpful? Give feedback.
-
I have SSO setup in my react native app. I've setup my supabase like so:
And then I have a wrapper that listens to auth changes:
And the fix for the original problem of this issue is fixed by doing the following in your
However this may be fixed now? not sure. And finally, the actual SSO takes place in a button component:
This works great for me atm. You obviously have to complete the usual google auth setup and have deep linking setup within your app, then you're all good. (Also remember to add your app link to your supabase project's auth callback url list) |
Beta Was this translation helpful? Give feedback.
-
After not finding any answers for a while, I've finally been able to solve my problem of trying to login with So for anybody trying to figure out how to login with
|
Beta Was this translation helpful? Give feedback.
-
Official documentation here:
|
Beta Was this translation helpful? Give feedback.
Official documentation here: