Expo bare workflow google signin auth error

Viewed 606

Google SignIn was working fine in managed workflow but stopped working when ejected. react-native-unimodules is properly configured. All other configurations are exactly the same. Getting following error.

Authorization Error

Error 400: Invalid_request invalid parameter value for redirect_uri: Missing authority: null:/oauth2redirect/googleenter image description here

ClientId is checked multiple times for confirmation.

Update: I ended up using the "@react-native-google-signin/google-signin" package and it worked fine.

2 Answers

Your redirect_uri (null:/oauth2redirect/google) isn't good,

your need to follow those instructions:

  • Bundle ID: Must match the value of ios.bundleIdentifier in your app.json.
  • Your app needs to conform to the URI scheme matching your bundle identifier.
    • Bare workflow: Run npx uri-scheme add <your bundle id> --ios
  • To test this you can:
    1. Eject to bare: expo eject and run yarn ios
    2. Create a custom client: expo client:ios
    3. Build a production IPA: expo build:ios
  • Whenever you change the values in app.json you'll need to rebuild the native app.

source

You should check some point below:

1.iosclientId is correct?

enter image description here

2.AccessToken should as this

const credential = firebase.auth.GoogleAuthProvider.credential(null, accessToken); firebase.auth().signInWithCredential(credential)

//Note the first parameter null

3.Add ClientID in Sign-in Method Firebase->Google->Enable->Safelist Client IDs.... -> paste ClientID into input-> Press 'Add'-> Done run yourProject

Related