Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FirebaseAuth - Requests from this Android client application <empty> are blocked

https://firebase.google.com/docs/auth/android/apple

We have developed Sign in with Apple on Android and confirmed that it is working properly.

But, if API key restricted to Android in the Google Cloud Console, it does not work with the following error.

com.firebase.ui.auth.FirebaseUiException: An internal error has occurred. [ Requests from this Android client application <empty> are blocked. ]
        at com.google.firebase.auth.api.internal.zzdv.zza(com.google.firebase:firebase-auth@@19.2.0:18)
        at com.google.firebase.auth.internal.zzal.onReceive(com.google.firebase:firebase-auth@@19.2.0:32)
        at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
        at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:7770)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1047)

An internal error has occurred. [ Requests from this Android client application <empty> are blocked. ]

If the API key is set to none, everything works properly.

Should API key restrictions be lifted to apply OAuth authentication such as Apple?

Or is there something else I missed?

For your information, I found 403 error in the Identitytoolkit.getProjects API.

Firebase Auth: Requests from this Android client application com.xxx are blocked

I've seen above discussion many times. But it's not a solution because adding or deleting signature makes it API Key restrictions are lifted automatically.

I don't think it's not SHA-1 signature problem because other APIs that use the same API Key do not have problems.

And I tested it with a demo project at https://github.com/firebase/FirebaseUI-Android, but the same problem happens.

I have no idea how to get authenticate using Apple to work properly when API Key is restricted to Android

like image 665
Leo Avatar asked Mar 25 '20 01:03

Leo


People also ask

What is firebase authentication in Android?

Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more.


1 Answers

If you are using Google Play App Signing, just login into Firebase go into "project settings"->"integration" and press a button to link Google Play with firebase, SHA-1 will be added automatically. Download and change your new google-services.json

If you keep having problems, go to Google Cloud API, click on the hamburger icon on the top left -> APIs and Services -> Credentials. Choose the API Key that you're using. Under restrictions, select "None".

like image 187
Ricardo Avatar answered Oct 10 '22 06:10

Ricardo