Supabase auth for React Native application

Hello,

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 token
const 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 AccesToken
const data = await AccessToken.getCurrentAccessToken()

if (!data) {
  throw 'Something went wrong obtaining access token'
}

// Create a Firebase credential with the AccessToken
const 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 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?

Thank you for your help much!
Was this page helpful?