Google-signin: GoogleSigninError: A non-recoverable sign in failure occurred

Created on 28 Jul 2017  Â·  46Comments  Â·  Source: react-native-google-signin/google-signin

Hello,
I have update the files as you described in doc. and I am getting below error
{ [GoogleSigninError: A non-recoverable sign in failure occurred] name: 'GoogleSigninError', code: 12500 }

Most helpful comment

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it in the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

All 46 comments

I have used android client id instead of webclient id . it is solved now

I have this problem. How did you fix it? I don't really get what you mean when you say android client id instead of web client id

@shyam528 please provide some more details how you solve it, what does it mean Android client id ?

@sherazi-maavan we can find Android Client Id from OAuth 2.0 client IDs section in here https://console.developers.google.com/apis/credentials?project=your_project_id .

In google developer console, in Credentials page you can find the Client Ids

@shyam528 Did you mean that we should you the web client ID instead of android client ID ?

@shyam528 (or anyone else reading along), did you mean for this step:

GoogleSignin.configure({
  scopes: ['https://www.googleapis.com/auth/drive.readonly'], // what API you want to access on behalf of the user, default is email and profile
  webClientId: '<FROM DEVELOPER CONSOLE>', // client ID of type WEB for your server (needed to verify user ID and offline access)
  offlineAccess: true, // if you want to access Google API on behalf of the user FROM YOUR SERVER
  hostedDomain: '', // specifies a hosted domain restriction
  forceConsentPrompt: true, // [Android] if you want to show the authorization prompt at each login
  accountName: '', // [Android] specifies an account name on the device that should be used
  iosClientId: '<FROM DEVELOPER CONSOLE>', // [iOS] optional, if you want to specify the client ID of type iOS (otherwise, it is taken from GoogleService-Info.plist)
});

you put the android client id instead of the web id for the webClientId field?

And to determine the android clientId versus the webClientId, if your google-services.json looked something like this:

{
  "project_info": {
    "project_number": "12345678",
    "firebase_url": "https://comcommyapp.firebaseio.com",
    "project_id": "comcommyapp",
    "storage_bucket": "comcommyapp.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:15564864124:android:4564asdfe48134",
        "android_client_info": {
          "package_name": "com.myapp.myapp"
        }
      },
      "oauth_client": [
        {
          "client_id": "12345678-5a1sdadfasd5f1aasdfe561651.apps.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "com.myapp.myapp",
            "certificate_hash": "basdaf123451adfaer13451avbzzz"
          }
        },
        {
          "client_id": "12345678-asdfq323fawefaw45151aefafe1.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AI_Qj123R__aq31413fafb"
        }
      ],
    }
  ],
}

you'd use 12345678-5a1sdadfasd5f1aasdfe561651.apps.googleusercontent.com for the webClientId instead of 12345678-asdfq323fawefaw45151aefafe1.apps.googleusercontent.com?

I am currently using 12345678-asdfq323fawefaw45151aefafe1.apps.googleusercontent.com, which seems to be working for some people, but I am also seeing the 12500 error for others :/

Edit: CC'ing #543 as it's related

any fix? experiencing this error..

same problems

i'm created tutorial google sign
https://youtu.be/E6Rdg0reKRI

```
GoogleSignin.hasPlayServices().then(()=>{
}).catch((err)=>{
console.log("Play service error", err.code, err.message);
})

    GoogleSignin.configure({
        scopes: ['https://www.googleapis.com/auth/drive.readonly'], // what API you want to access on behalf of the user, default is email and profile
        ClientId:             
      });
    }

```

use CliendId instead webClientid and get the CliendId from https://console.developers.google.com/apis/credentials?project = "Your project Name". Dont forget to replace cliendt id in google-servcies.json too.

any solution , i am facing this error.
A non-recoverable sign in failure occurred

Check the id. The firebase id is diffeent from google console id.

Try this:

GoogleSignin.configure({
    scopes: ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.metadata', 'https://www.googleapis.com/auth/drive.appdata', 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive.metadata.readonly', 'https://www.googleapis.com/auth/drive.scripts', 'https://www.googleapis.com/auth/drive.readonly', 'https://www.googleapis.com/auth/drive.photos.readonly'],
    ClientId:'........apps.googleusercontent.com',       

  });

This CliendId is not the id found in google-services. Is different fom firebase id.

@uendar sir, i did as you said,
screenshot from 2018-12-18 11-20-39

and here below is my code...
screenshot from 2018-12-18 11-19-49

sir, still getting error, plz help me sir. i am noob in react-native

Make sure you enable your project https://console.developers.google.com/apis/library/drive.googleapis.com...... and try. if there is any problem tell me :)

sir, still getting same error

screenshot from 2018-12-18 14-54-11
i have enabled

Did you do the configuration as in document descrription?

On Tue, Dec 18, 2018 at 10:24 AM kalraneeraj24550 notifications@github.com
wrote:

[image: screenshot from 2018-12-18 14-54-11]
https://user-images.githubusercontent.com/44640902/50144276-cf8da680-02d4-11e9-9475-5aed49a5dd49.png
i have enabled

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-native-community/react-native-google-signin/issues/265#issuecomment-448153276,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANQWJapx3n0NjV-B9wuRWwf89Dhh4fetks5u6LRagaJpZM4OmbGa
.

yes sir, i did. which file would you like me to show you

well i can shate a demo project where react-native-google-signin works. You
can check the configurations. If there are problems again write me

On Tue, Dec 18, 2018 at 10:29 AM kalraneeraj24550 notifications@github.com
wrote:

yes sir, i did. which file would you like me to show you

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-native-community/react-native-google-signin/issues/265#issuecomment-448154729,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANQWJbXkR-Hd58PZ0YMjRY7XY3_yqikZks5u6LWEgaJpZM4OmbGa
.

give me your email i can check your project if you want :)

On Tue, Dec 18, 2018 at 10:32 AM Endar Uliu endar8@gmail.com wrote:

well i can shate a demo project where react-native-google-signin works.
You can check the configurations. If there are problems again write me

On Tue, Dec 18, 2018 at 10:29 AM kalraneeraj24550 <
[email protected]> wrote:

yes sir, i did. which file would you like me to show you

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/react-native-community/react-native-google-signin/issues/265#issuecomment-448154729,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANQWJbXkR-Hd58PZ0YMjRY7XY3_yqikZks5u6LWEgaJpZM4OmbGa
.

my email is neeraj.[email protected]
yes you can check my project.
thanks sir, for helping me

anyone plz suggest me, am still facing this issue.
A non- recoverable signin failure occured 12500

I fixed by adding correct SHA certificate fingerprint to my firebase project.
This key was by default for me:
keytool -exportcert -keystore ~/.android/debug.keystore -list -v

how to get correct sha. bcoz i have already added SHA certificate. got by this command.
keytool -exportcert -keystore ~/.android/debug.keystore -list -v.
how can we get know that our sha is correct or not

tried almost all above solutions (enabled all the APIs from google console,tried both client id and weclient id,updated fingerprint) nothing solved my problem

Even i had the same error it took a whole day for me to solve it. It was because of the SHA -1 certificate problem. i gave the value from different keystore in the firebase ,hence google-services.json had some wrong client id which was making the request fail so i did the following steps.
1)deleted the SHA-1 key from firebase
2) generated the key (referring to this article ->[https://developers.google.com/android/guides/client-auth])
3)placed the key in the fire base and generated new google -services.json file

always use :- keytool -exportcert -list -v -alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
commond dont even change the path(in windows)
default password:-android

@ashwath20 sir, what did you mean by "gave the value from different keystore".
i did the steps as you did am still facing the same error.
and
the web client id is same in firebase as same in google-services.json file. i have no idea where am lacking.
sir, can you plz guide me

your client id is based on the SHA1 key you provide . so generate the key from "%USERPROFILE%.android\debug.keystore" @kalraneeraj24550

i have solved it by having sha-1 from android studio not by command line

In my case, I was getting this because I switched my system and that now had a different debug.keystore.
Didn't know that initially, but when I did, I followed this and added the new SHA1 to firebase console. Worked for me!

http://developerextensions.com/help/230-Google-signin-returns-12500,-12501-error-code-

I had a same problem. I switched from one mac to another, and the SHA-1 is changed. I needed to generate new SHA-1 and update firebase console. Also after you add new SHA-1 to firebase, you need to download new google-services.json and replace with older one in your android project app folder. Thank you @amit-gitrepo for hint.

Set Support email in firebase settings

I searches and came across the following steps

  1. Enable OAuth on https://console.developers.google.com
  2. Copy and paste your SH1 while enabling
  3. Enable Google sign in on firebase authentication
  4. Add sha-256 to firebase android app settings
  5. Use Oauth Client_Id instead of your WebClient ID

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it in the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

Man, i want to kiss your foots, I was trying for two days and now it is working!!! Thank you so much

@jasperkuperus I'm trying all steps but I got this error on 'release Apk'

Error: A non-recoverable sign in failure occurred

Although In development I don't get any error and I can sign in!

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

Thanks;
Its working and proper steps to solve this issue .

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

This instruction works for apk and local debugging. For.aab builds it not works.
But it's easy to fix, go to:
play store console -> your app -> Release management -> App signing
Under "App signing certificate" section copy your SHA1 key and paste it as on 3rd step-

  1. Firebase Console under Project Settings, Android app, add the SHA1

try with a physical device since in the emulator it did not work but with the physical device yes, I followed the steps of @jasperkuperus

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

I tried it in React Native CLI and worked! Maybe in expo project should be run in production mode.

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

@jasperkuperus Should we not be using the SHA1 key thats linked to Task :react-native-community_google-signin:signingReport instead?
its interesting to find out that the path of the signing Key you mentioned and Task :react-native-community_google-signin:signingReport are not same. one is defined inside app the other is defined globally.
any thoughts on it?

@jasperkuperus Should we not be using the SHA1 key thats linked to Task :react-native-community_google-signin:signingReport instead?
its interesting to find out that the path of the signing Key you mentioned and Task :react-native-community_google-signin:signingReport are not same. one is defined inside app the other is defined globally.
any thoughts on it?

Sorry, this is quite a long time ago. I don't really remember and I'm not very familiar with this. I just know that my approach worked for me. If what you propose is better, and works... Then that might be a better answer. But maybe a contributor can chime in on this? I have a lack of knowledge to properly answer your question.

Thanks @jasperkuperus !! Until an actual contributor can share their thoughts,
https://github.com/react-native-google-signin/google-signin/issues/265#issuecomment-616072044
fixed my issue. 🙌 🚀

If anyone facing this issue still, don't use the default webClientId created by your firebase project. Create a new web client Id from the google cloud developer console for your project and use that instead.

What worked for me:

  • cd ./android && ./gradlew signingReport
  • Take the SHA1 of Task :app:signingReport, Variant: debugAndroidTest, Config: debug
  • Update it in the Firebase Console under Project Settings, Android app, add the SHA1
  • Download the google-services.json, put it in ./android/app
  • Go to Authentication, then Sign-in method, then press Google
  • Take the Web client ID and use that for your GoogleSignin.configure({ webClientId: ... });
  • This Web client ID should be the same as listed in https://console.developers.google.com/apis/credentials?project=<your_project_id> -> Credentials -> OAuth 2 Client ID -> Web Client

I've been struggling with this for hours today and it finally solved my issue 😭 Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings