EddyVerbruggen / cordova-plugin-googleplus

:heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android
566 stars 625 forks source link

Error 12500 #340

Open joaquinND10 opened 7 years ago

joaquinND10 commented 7 years ago

Hello, I get this error, and I can not understand that it may be wrong, my login code is this ..

GooglePlus.login({
        'scopes': ['email','id','name','picture'], // optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.
        'webClientId': '<number>-<string>.apps.googleusercontent.com', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required.
        'offline': true
    }).then((user) => {

In config.xml I've this..

  <plugin name="cordova-plugin-googleplus" spec="~5.1.1">
    <variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps.<string>-<number>"/>
  </plugin>

My code to generate the hasg is this ...

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v

some clue?

ervaibhavsinghal commented 7 years ago

@joaquinND10 do one thing.. may be it'll solve your issue. check your SHA1 certificate which you are using in app or google server.

Locally you can check with the this command: keytool -exportcert -keystore ~/.android/debug.keystore -list -v -alias androiddebugkey

On Server: https://console.developers.google.com/apis/credentials

and in app also get the certificate: <button onclick="window.plugins.googleplus.getSigningCertificateFingerprint(function(res){alert(res)}, function(res){alert(res)})">get cert fingerprint (Android)</button>

check all are same or not?

J-Yen commented 7 years ago

I fixed the problem by specifying the location of the keystore: https://www.webniraj.com/2016/11/21/cordova-changing-the-default-debug-keystore-for-android-applications/

debojyoti commented 6 years ago

@J-Yen Thanks man! This was the real issue. I have written a step-by-step solution: https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/242#issuecomment-437587582

prithvihv commented 6 years ago

@debojyoti anything else i can try :/ that didnt work for me

allanpoppe commented 6 years ago

I'm also having this issue, with no luck of success.

SergioZhydecky commented 6 years ago

the same issue, on live with old ionic and with ionic 4

prashanteb commented 5 years ago

I have solved it by changing REVERSED_CLIENT_ID if client id 123-xyz.apps.googleusercontent.com then you need to reverse it com.googleusercontent.apps.123-xyz

Example: Client id in google develper tool is : 123-xyz.apps.googleusercontent.com and command below is with reverse client id

cordova plugin add cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=com.googleusercontent.apps.123-xyz

in component call login function without any data

 this.googlePlus
      .login({})
      .then(res => {
           console.log(res);
      })
      .catch(err => {
        console.error(err);
            });