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

"errorMessage":"The operation couldn’t be completed. (com.google.GIDSignIn error -8.)"} #261

Open
shinji1985 opened this issue Feb 12, 2023 · 7 comments

Comments

@shinji1985
Copy link

shinji1985 commented Feb 12, 2023

When i run my app in iOS in both of real device and simulator, Google authentication dialog is opened correctly and input my google account then submit. Google authentication is closed and I got the error below in console.

"errorMessage":"The operation couldn’t be completed. (com.google.GIDSignIn error -8.)"}

I use "@codetrix-studio/capacitor-google-auth": "^3.2.2".
All settings seem to be correct.

my code is below

import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
…
  async handleSignInClick() {
    let googleUser = await GoogleAuth.signIn();
    console.log('googleUser', googleUser);
…

Do you know why the error occur?
This is my environment

Ionic:
   Ionic CLI                     : 6.20.8
   Ionic Framework               : @ionic/angular 6.5.3
   @angular-devkit/build-angular : 15.1.4
   @angular-devkit/schematics    : 15.1.4
   @angular/cli                  : 15.1.4
   @ionic/angular-toolkit        : 6.1.0

Capacitor:
   Capacitor CLI      : 4.6.2
   @capacitor/android : 4.6.2
   @capacitor/core    : 4.6.2
   @capacitor/ios     : 4.6.2

Utility:
   cordova-res : 0.15.4
   native-run  : 1.7.1

System:
   NodeJS : v18.12.1 
   npm    : 8.19.2
   OS     : macOS

Thanks

@shinji1985
Copy link
Author

After I re-build project without firebase, it works!
Thanks.

@shinji1985
Copy link
Author

I found how to reproduce this problem.
When I specify https://www.googleapis.com/auth/calendar or https://www.googleapis.com/auth/drive in scope.
It works at first time.
But after sign out then try to sign in, this error occur in iOS.

"errorMessage":"The operation couldn’t be completed. (com.google.GIDSignIn error -8.)"}

After I disconnect my google app from my account https://myaccount.google.com/permissions?continue=https%3A%2F%2Fmyaccount.google.com%2Fsecurity
Then try to sign in, it works.

This problem seems to occur when I have already passed permissions to the designated scope on my Google account on the second and subsequent logins.

@shinji1985 shinji1985 reopened this Mar 6, 2023
@AlvinTCH
Copy link
Contributor

AlvinTCH commented Apr 6, 2023

I am currently using a quick workaround for this whereby if I detect the error is -8, I will use the refresh flow

GoogleAuth.refresh()

This will enable me to get the authenticationToken and the refreshToken of the user that is currently being signed in

@filipRisteski
Copy link

Any progress on this issue ?

@bbjoern
Copy link

bbjoern commented Jun 9, 2023

Same issue here

@zjmeyer25
Copy link

Any update on this?

@paddyabc
Copy link

I have the same issue in iOS
With the same code, Android works fine, it is just the problem in iOS
I am using the suggestion by @AlvinTCH . When I got the GIDSignIn error -8 message, I will try the refresh flow.
If the refresh flow still have the problem, then I will throw the exception.

Using this logic, it works fine in my iOS app now

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

No branches or pull requests

6 participants