CodetrixStudio / CapacitorGoogleAuth

Capacitor plugin for Google Auth. Lightweight & no dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Error Code: 10

ferencznora opened this issue · comments

I’m encountering a persistent issue on Android while trying to retrieve the ID token using GoogleAuth.signIn(). It’s worth noting that this issue does not occur on iOS and Web platforms.

Configuration:
Capacitor Config (capacitor.config.ts):

{
 “plugins”: {
  “GoogleAuth”: {
   “scopes”: [“profile”, “email”],
   “clientId”: “WEB_CLIENT_ID.apps.googleusercontent.com”,
   “serverClientId”: “WEB_CLIENT_ID.apps.googleusercontent.com”,
   “androidClientId”: “WEB_CLIENT_ID.apps.googleusercontent.com”,
   “iosClientId”: “IOS_CLIENT_ID.apps.googleusercontent.com”,
   “forceCodeForRefreshToken”: true
  }
 }
}

strings.xml:
<string name=“server_client_id”>WEB_CLIENT_ID.apps.googleusercontent.com</string>

MainActivity:

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  registerPlugin(com.codetrixstudio.capacitor.GoogleAuth.GoogleAuth.class);
}

Additional Information:
• The Android client ID was created on August, 2023.
An Android client ID specific to OAuth2 has been generated with the SHA-1 certificate fingerprint set. I’ve tried both the debug and production keys without success.
The Google login functionality does not work locally or in production, which is critical for my application. I’ve spent a significant amount of time investigating this issue. Has anyone been able to resolve this problem recently?
Please provide any insights or solutions if you’ve encountered a similar issue or have suggestions for resolving it. Your assistance is greatly appreciated.

I have the same problem here. I try the solution from here #291 but nothing works.
Apple works fine.

Please try this #220. Try to the web client ID instead of an android client id.

also please check #220 (comment) - this particular comment

I ran into this issue trying to integrate with Supabase. For me, ensuring that clientId, androidClientId, and serverClientId were all the same OAuth2 Web Client ID did the trick.

Thanks @ALL it works 🤟