0

I'm trying to add the Google-plus login to my app, but no matter what I do I cannot get it working on a real Android device. So far I was able to get the idToken from this plugin cordova-plugin-googleplus Using Firebase's singInWithCredential(idToken) I get an error that said:

This app, identified by the domain where it is hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.

I want to point out that I follow all the steps for the installation, SHA1 key are correct and I am using signed APKs. Using the facebook plugin, retrieving the token and signInWithCredential worked without any issue.

Thanks in advance!

Devid Farinelli
  • 7,514
  • 9
  • 42
  • 73
Du_
  • 915
  • 1
  • 9
  • 16

2 Answers2

0

it seems like you have some API key restrictions that are not met by your ionic application.

To begin with, please check you are using the API key from the "Web setup" popup, under the auth section of the Firebase console for your project. This one should work out of the box if you have not changed your configuration in the API console.

If that doesn't fix the issue, go to the credentials section of the Google API console for your Firebase project, look for the API key that you are using, and check which referrer restrictions are set there and ensure they are met by your application. Read this answer for several options that you have to set up your API key restrictions for a Cordova app.

Community
  • 1
  • 1
0

In my Ionic2 RC1 + Firebase3.5 + AngularFire2.beta5 project I had the same problem... Google Auth with Popup worked in Browser but not in my Android .APK

Note.- I didn't use Tokens in my App

Firstly, I add 192.168.1.172 to my Firebase Console authorized domain list and <allow-navigation href="http://192.168.1.172:8100"/> to my config.xml.

After this, I found that installing Cordova InAppBrowser plugin solves my problem definitively.

I didn't need to modify my code, only plug and play, exactly like David East says in his Social login with Ionic blog.

JavierFuentes
  • 1,840
  • 18
  • 13