capawesome-team / capacitor-firebase

⚡️ Firebase plugins for Capacitor. Supports Android, iOS and the Web.
https://capawesome.io/plugins/firebase/
Apache License 2.0
393 stars 101 forks source link

bug: Twitter and Apple logins don't work #202

Closed jirihajek closed 1 year ago

jirihajek commented 2 years ago

Plugin(s): @capacitor-firebase/authentication@1.0 (and the latest dev version as well)

Platform(s): Android

Current behavior: Login to Twitter or Apple results in the following error on the Android device:

{"error":{"code":403,"message":"Requests from this Android client application <empty> are blocked.",
"errors":[{"message":"Requests from this Android client application <empty> are blocked.",
"domain":"global","reason":"forbidden"}],"status":"PERMISSION_DENIED",
"details":[{"@type":"[type.googleapis.com/google.rpc.ErrorInfo](http://type.googleapis.com/google.rpc.ErrorInfo)",
"reason":"API_KEY_ANDROID_APP_BLOCKED","domain":"[googleapis.com](http://googleapis.com/)",
"metadata":{"consumer":"projects/**********",
"service":"[identitytoolkit.googleapis.com](http://identitytoolkit.googleapis.com/)"}}]}}

Steps to reproduce: await FirebaseAuthentication.signInWithTwitter({ skipNativeAuth: false }) or await FirebaseAuthentication.signInWithTwitter({ skipNativeAuth: true }) both result in the problem. Note that I'd say that all my configuration is correct, as the native Firebase Android login to Facebook or Google work fine. And also web based Firebase login to Twitter or Apple work fine.

Capacitor doctor: Latest Dependencies: @capacitor/cli: 4.1.0 @capacitor/core: 4.1.0 @capacitor/android: 4.1.0 @capacitor/ios: 4.1.0 Installed Dependencies: @capacitor/ios: not installed @capacitor/cli: 4.1.0 @capacitor/android: 4.1.0 @capacitor/core: 4.1.0

robingenz commented 2 years ago

This must be a configuration issue. Please have a look at this SO answers: https://stackoverflow.com/questions/51925442/firebase-auth-requests-from-this-android-client-application-com-xxx-are-blocked

Please try to create a minimal, reproducible example with a fresh Firebase and Twitter project. Maybe you find the root cause this way.

jirihajek commented 2 years ago

Thanks for your reply! As for the correct SHA-1 solution from SO, I think that I've got this right, since I not only manually checked the hash, but also FB and Google logins work fine from the compiled Android app (and they didn't until the hash was correctly configured). I don't see any reason why Twitter wouldn't work, since its only specific configuration is also definitely correct, as I can login to the account through firebaseui library (the same firebase account).

I think that a hint might be in the message Requests from this Android client application <empty> are blocked., since I wouldn't expect <empty> title. It looks like the requests to Firebase get somehow corrupted, but I don't understand how can this happen. :confused:

robingenz commented 2 years ago

Unfortunately I can't help you as long as I can't reproduce and debug the issue.

These issues seem to have the same problem:

github-actions[bot] commented 1 year ago

It looks like there hasn't been a reply in 30 days, so I'm closing this issue.