Google signin error after capacitor migration

I migrated my ionic cordova angular app to latest capacitor.

I’m happy because the app build and run on physical device but Google SignIn not works.

I removed cordova plugin and installed capacitor plugin @codetrix-studio/capacitor-google-auth

I can’t understand the error because I receive generic google error

“Something went wrong”
“code”:"10

{"save":false,"callbackId":"82381424","pluginId":"GoogleAuth","methodName":"signIn","success":false,"error":{"message":"Something went wrong","code":"10"}}

Can anyone tell me if I need to update the SHA-1 certificate in my Google project?

In app show the modal with google account selection but after generate error code 10 :frowning:

Thanks

There is this issue that might have some tips - Getting error Something went wrong, code: 10 · Issue #291 · CodetrixStudio/CapacitorGoogleAuth · GitHub

Sure. I already read this hread but I can’t solve. Very Strange.

I integrated plugin on my ionic capacitor app. On iOS, it works. On Android Device I always receve this error:

{"save":false,"callbackId":"29072639","pluginId":"GoogleAuth","methodName":"signIn","success":false,"error":{"message":"Something went wrong","code":"10"}}

I configured all as wiki but I can’t solve.

I have some doubts:

  1. Downloaded from firebase console my google-services.json. Is it required? Where I need to save it?

  2. I can’t have “capacitor.config.json” file. I have only capacitor.config.ts

  3. In google-service.json file there are several codes:

  4. What is “serverClientId”?

  5. What is the crrect SHA-1 to register at Android Console?
    a) That present in Google Play Console?
    b) Thant generate from command line (keytool -keystore MYKEYSTORE -list -v)?

My google-services.json file is:

{
  "project_info": {
    "project_number": "*******",
    "project_id": "myapp-c7381",
    "storage_bucket": "*******-c7381.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:359711685148:android:5db8f05cc8c23360433dd9",
        "android_client_info": {
          "package_name": "it.********"
        }
      },
      "oauth_client": [
        {
          "client_id": "359711685148-aaaaaaaaaaaaaaaaaa.apps.googleusercontent.com",
          "client_type": 1,
          "android_info": {
            "package_name": "it.gemarexpress",
            "certificate_hash": "dsadasdasdsadada"
          }
        },
        {
          "client_id": "359711685148-kkkk.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "***********"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "359711685148-xxxx.apps.googleusercontent.com",
              "client_type": 3
            },
            {
              "client_id": "359711685148-yyyy.apps.googleusercontent.com",
              "client_type": 2,
              "ios_info": {
                "bundle_id": "**********"
              }
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

My capacitor.config.ts

As “androidClientId” I used “client.oauth_client.client_id”. The same of there is on Google Cloud Console, OAuth 2.0 Client IDs as “[Android client for it.gemarexpress (auto created by Google Service)]”

image

  plugins: {
    GoogleAuth: {
      scopes: ['profile', 'email'],
      iosClientId: "359711685148-xxx.apps.googleusercontent.com",
      androidClientId: "359711685148-yyy.apps.googleusercontent.com",
      serverClientId: 'xxxxxx-xxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
      forceCodeForRefreshToken: true,
    },
  }