Using without Firebase
We are running without Firebase and using only google cloud to create OAuth 2.0 Client IDs for two for android and one for web application. I've added the SHA from Google Play store for the other android client id and debugkey SHA for the other android client id. OAuth consent Publishing status: Testing.
Using: "@capacitor-community/facebook-login": "^3.0.0", "@capacitor/android": "^3.0.1", "@capacitor/app": "^1.0.1", "@capacitor/cli": "^3.0.1", "@capacitor/core": "^3.0.1", "@capacitor/haptics": "^1.0.1", "@capacitor/ios": "^3.0.1", "@capacitor/keyboard": "^1.0.1", "@capacitor/status-bar": "^1.0.1", "@codetrix-studio/capacitor-google-auth": "^3.0.1”, "react": "^17.0.2",
Configured the Web application's client id in server_client_id inside strings.xml as well as in serverClientId capapacitor.config.json.
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
registerPlugin(GoogleAuth.class);
registerPlugin(FacebookLogin.class);
}
}
Google login on IOS and web works perfect but android google login still fails with:
On emulator and on actual phone I'm not getting errors on Logcat but nothing happens after the popup:
It closes the popup on Allow, but does not send any errors nor does it authenticate the user.
This boiled down to the same issue as reported by https://github.com/CodetrixStudio/CapacitorGoogleAuth/issues/53 . Hence access_token is missing from android GoogleAuth.signIn() response which is expected to be received on login by our backend.