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

Issue with Google Authentication in Ionic using @awesome-cordova-plugins/google-plus #4842

Open
PatricioRedegal opened this issue Sep 24, 2024 · 1 comment

Comments

@PatricioRedegal
Copy link

I'm using the @awesome-cordova-plugins/google-plus/ngx library to implement Google authentication in my Ionic project. Here’s the code I'm using:

loginGoogle() {
    const clientId = this.platform.is('android') ? this.androidClientId : this.iosClientId;
    
    this.googlePlus.login({
      webClientId: clientId,
      offline: false,
    })
    .then((res) => {
      console.log("GOOGLESIGN Login successful", res);
      this.socialLogin(res.userId, 'google', res.email, res.givenName, res.familyName);
    })
    .catch((err) => {
      const errorCode = err?.code ?? 'undefined';
      const errorMessage = err?.message ?? 'undefined';

      this.alert.errorAlert("Error code: " + err);
    
      if (errorCode === 12501) {
        console.error("GOOGLESIGN Error: User canceled the login.");
      } else if (errorCode === 10) {
        console.error("GOOGLESIGN Error: Incorrect OAuth client configuration.");
      } else {
        console.error("GOOGLESIGN Unknown error during Google login.");
      }
    });
}

I'm always receiving errorCode = 10. I have verified that the credentials are correctly set up in Google Cloud with the corresponding SHA-1 for the Android app.

Has anyone encountered a similar issue or can help me resolve this? Thank you!

@MaximBelov
Copy link
Contributor

Hi @PatricioRedegal
Your issue is not related to this repository.

It looks like the plugin is unmaintained by the author https://github.com/EddyVerbruggen/cordova-plugin-googleplus

You should check the forks or try to find another plugin for google-plus sign-in

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

2 participants