Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: A non-recoverable sign in failure occurred When use webClientId #564

Closed
dung-nguyentien opened this issue Nov 10, 2018 · 25 comments
Closed

Comments

@dung-nguyentien
Copy link

I encountered this error when used

GoogleSignin.configure({
      webClientId: env.GOOGLE_WEB_ID,
      offlineAccess: true,
    });

It works if I remove webClientId (Webclient already active in web version). But i need use serverAuthCode. How to fix it, I tried the solution at the forum but could not fix it :(
My scope in google console.
image

@dung-nguyentien dung-nguyentien changed the title Error: A non-recoverable sign in failure occurred When use ư Error: A non-recoverable sign in failure occurred When use webClientId Nov 10, 2018
@zoi-aoba
Copy link

SAME HERE!!!

@kopai001
Copy link

same here too

@vonovak
Copy link
Member

vonovak commented Nov 12, 2018

hi, one of the maintainers here. I'm not using this functionality and don't have time to fix this. If there's anyone using the lib who needs this, please go ahead and provide a PR for this, I'll be available for code review and help if necessary.

Thanks.

@dung-nguyentien
Copy link
Author

When creating a project, select an existing project at console.cloud.google.com. It works for me.
image

@zoi-aoba
Copy link

finally, I understood.
You have to go to Firebase console > authentication > google signin (make activate!) > web SDK setting.
And its "Web client SDK" would be used for GoogleSignin.configure .

@kishanmundha
Copy link

Hey @goleador0322, It work. I register app into firebase and configure SHA1 and app package name. after configure it work without any issue. Thanks

@kalraneeraj24550
Copy link

sir, i did the same steps. i am getting same error. @kishanmundha , @goleador0322 sir can you help me.

componentDidMount() {

    GoogleSignin.hasPlayServices({ showPlayServicesUpdateDialog: true })
        .then(() => {
            
            // play services are available. can now configure library
        })
        .catch(err => {
            console.log('Play services error', err.code, err.message);
        });


        GoogleSignin.configure();


        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
       //     //   iosClientId: '<FROM DEVELOPER CONSOLE>', // only for iOS
       //   //  webClientId: "295437555563-qh5qqili26q3hm3ggpn4d7fh887ahu30.apps.googleusercontent.com" // client ID of type WEB for your server (needed to verify user ID and offline access)
            webClientId: '438492594100-eum221fmi9m45pso1qeoieo9aje02f7t.apps.googleusercontent.com' // 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
       });


    
}

googleSignIn = async () => {
    console.log('function running');
    try {
        const userInfo = await GoogleSignin.signIn();

        console.log(userInfo);
        ToastAndroid.show('user info=' + userInfo, ToastAndroid.SHORT);

        // this.setState({ userInfo });
    } catch (error) {
        if (error.code === statusCodes.SIGN_IN_CANCELLED) {
            console.log('error 1', error);
        } else if (error.code === statusCodes.IN_PROGRESS) {
            // operation (f.e. sign in) is in progress already
            console.log('error 2', error);
        } else {
            console.log('error 3', error);
            ToastAndroid.show('error=' + error, ToastAndroid.SHORT);

            // some other error happened
        }
    }
};

sir this is my code

@ashwath20
Copy link

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

@ogalaxy-gs
Copy link

Set Support email in firebase settings

@ckOfor
Copy link

ckOfor commented May 22, 2019

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

@ckOfor
Copy link

ckOfor commented May 22, 2019

request

I get developer error

@uchar
Copy link

uchar commented Jun 21, 2019

Thanks all !
I solve it by doing the following steps :

  • Setting both SHA1 and SHA256 in firebase from this link
  • Activate Firebase console > authentication > google signin
  • use web SDK setting and "Web client SDK" for GoogleSignin.configure .
  • Setting Support email in firebase settings

@MuhammadUmar00
Copy link

MuhammadUmar00 commented Aug 1, 2019

if HAVING DEVELOPER_ERROR or "non recoverable sigin error" ......

any one having issues with debug mode can watch this vedio it will satisfy you it has complete google login working with react native cli (init version )

link:
https://www.youtube.com/watch?v=AHVaxhcoY98&t=124s

@Artem-Kushch
Copy link

Go to https://console.developers.google.com/apis/credentials > create or use existing web OAuth 2.0 client > use client id of this web client in GoogleSignin.configure
For me, these steps fixed the problem.

@rchouhan170590
Copy link

Add support email in firebase your settings 👍

  1. Go to Firebase
  2. Go to your Project
  3. Go to Project Settings
  4. In public settings support email option ( Add your email there).

@deepas96
Copy link

deepas96 commented Dec 19, 2019

@uchar It worked for me. Thanks!
Setting both SHA1 & SHA256 in firebase from the given link worked well.

@ravi-pandit14
Copy link

@uchar Not working for me
i have tried all of the cases
?????????????

@jasperkuperus
Copy link

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

@victorbruce
Copy link

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 solution solved my issue. I was using a wrong sha-1 key instead. Hence I followed your instructions and used the sha-1 key under app:SigningReport instead with the variant: debugAndroidTest

@srht
Copy link

srht commented Feb 1, 2021

For my problem, I copied the application signing sha1 hash code from Application signing key certificate part of google play console > Release Management > App Signing page. Then I pasted it to Firebase settings and this solved the problem.

@huynguyen199
Copy link

At first I got the code inside 'oauth_client' but actually we should get 'client_id' in 'service' of file 'google-services'
GoogleSignin.configure({ webClientId: 'client_id of services' });

@hugoh59
Copy link

hugoh59 commented Mar 3, 2021

I have tried every single solution on the internet and still getting Error: A non-recoverable sign in failure occurred

@dfjerry
Copy link

dfjerry commented Mar 8, 2021

Tôi đã thử mọi giải pháp trên internet và vẫn nhận được Error: A non-recoverable sign in failure occurred

metoo :(

@dung-nguyentien
Copy link
Author

When creating a project, select an existing project at console.cloud.google.com. It works for me.
image

@hugoh59 @dfjerry
Did you try it? It's works for me.

@gauravjaadhav
Copy link

I have tried every single solution on the internet and still getting Error: A non-recoverable sign in failure occurred

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests