I try to use supabase auth for React Native application.
I use @react-native-google-sign and @react-native-fbsdk-next. For Google it should be something like:
const { idToken } = await GoogleSignin.signIn()// Create a Google credential with the tokenconst googleCredential = supabase.auth.signInWithIdToken({ provider: 'google', token: idToken,})
const { idToken } = await GoogleSignin.signIn()// Create a Google credential with the tokenconst googleCredential = supabase.auth.signInWithIdToken({ provider: 'google', token: idToken,})
For Facebook similar:
const result = await LoginManager.logInWithPermissions(['public_profile', 'email'])if (result.isCancelled) { throw 'User cancelled the login process'}// Once signed in, get the users AccesTokenconst data = await AccessToken.getCurrentAccessToken()if (!data) { throw 'Something went wrong obtaining access token'}// Create a Firebase credential with the AccessTokenconst facebookCredential = await supabase.auth.signInWithIdToken({ provider: 'facebook', token: data.accessToken,})
const result = await LoginManager.logInWithPermissions(['public_profile', 'email'])if (result.isCancelled) { throw 'User cancelled the login process'}// Once signed in, get the users AccesTokenconst data = await AccessToken.getCurrentAccessToken()if (!data) { throw 'Something went wrong obtaining access token'}// Create a Firebase credential with the AccessTokenconst facebookCredential = await supabase.auth.signInWithIdToken({ provider: 'facebook', token: data.accessToken,})
But it does not work.
There are questions I have: 1. For Facebook
AccessToken.getCurrentAccessToken
AccessToken.getCurrentAccessToken
returns base64, but not JWT. 2. For Google I have not found where to find or required parameters to configure the integration?
Could you please help me to figure out on how to implement it and move from Firebase to Supabase?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.