Angularfire: issue with Firebase 3 API Google Authentication.

Created on 28 Jun 2016  路  7Comments  路  Source: angular/angularfire

I'm migrating our bookdash app to the latest version of Angularfire to support the 3.0 API. Our API calls are working great, but we are having issues with authentication using Google. When we moved things over to the new version I enabled Google via the sign-in method, but while figuring things out added in the web client id and Web Client Secret that we had used for the previous version of our app from the Google API Console (which I later figured out wasn't necessary).

When the app initialized I would get the following message.
"
_www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=AIzaSyDcjx0c_7C5wcisNm-NFimYIPZUuPQvuxY&cb=1467062628611:1 GET https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=AIzaSyDcjx0c_7C5wcisNm-NFimYIPZUuPQvuxY&cb=1467062628611 403 ()
iframe.js:318 [ 0.128s] [firebase-auth] Info: The current domain is not authorized for OAuth operations. This will prevent signInWithPopup, signInWithRedirect, linkWithPopup and linkWithRedirect from working. Add your domain to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method _tab.__
"

After it initialized if I tried to call the login method I would get a similar 403 message.

The domain I was calling this from was localhost and that was listed in the domains.

I was thinking that since these values were optional that if I deleted these values in the firebase console it might be the cause of this, but the console won't let me do that. If I change the web client id and web client secret to a random letter the initialization error goes away but now I get a popup that quickly disappears when I call login with no message on the console.

You can see the the full app (It's a WIP branch) here https://github.com/bookdash/bookdash-backend-admin-portal/tree/firebase3 . The login is happening in app/components/toolbar.component.ts . I'm trying to figure out if this is a configuration issue with Firebase or something related to AngularFire (either my configuration or a bug).

Most helpful comment

The solution for us was adding _my-app_.firebaseapp.com (being _my-app_ the unique identifier of our Firebase App) to the _HTTP referrers_ in the _Browser-Key Credentials_ from the _Google APIs console_ and wait some time to propagate.

After many months of development the app never had a problem, and we are sure we never removed such referrer (if it was ever there).

Anyway... it's done and learned.

(The solution was resolved under advice of email support after asking over StackExchange Firebase for support: http://stackoverflow.com/questions/42015155/firebase-authentication-partially-working-only-email?noredirect=1#comment71243882_42015155)

All 7 comments

Ok, the api information for the web client id and web client secret should have been pointing at a associated api entry, but I also needed to go here https://console.developers.google.com/apis/api/identitytoolkit/overview?project=book-dash to enable this...... not sure if this is specific to our set up or a gap in Firebase's documentation, but either way this solved things for us. so I'm going to close this out.

Facing the same problem here. What's the exact name of the API you needed to enable there? Thanks a lot.

I have the same issue, I tried to access the API up but could not. does anyone have any idea what to do to solve this? Thanks a lot.

I am using the Database and Storage API without any authentification. I also received the warning that my domain name was not authorized for OAuth operations. I added my domain name in the 'Auth section' and voila it works pretty without any warnings.

Error message was:
[ 0.515s] [firebase-auth] Info: The current domain is not authorized for OAuth operations. This will prevent signInWithPopup, signInWithRedirect, linkWithPopup and linkWithRedirect from working. Add your domain to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.

After trying localhost, ngrok, docker ip, this ip, that ip, nothing worked... SO...

As lgleasain Pointed out, the remedy for this issue is by following the

https://console.developers.google.com/apis/api/identitytoolkit/settings?project=your-firebase-project-id

Remember to add your project id in the URL ..

That is the identity toolkit.

In the settings tab, you will find the apiKey pre-configured based on the OAuth 2.0 client IDs you want to use, or is associated with your project. And THAT is the apiKey you want to add to your firebase configuration object...

Now, I still had errors after I've done that.

They also want the correct redirect url in the google developers console under the same OAuth 2.0 client IDs.

So add:

https://your-firebase-project-id.firebaseapp.com/__/auth/handler

And you should be good to go.

A disaster; what can I say..

The solution for us was adding _my-app_.firebaseapp.com (being _my-app_ the unique identifier of our Firebase App) to the _HTTP referrers_ in the _Browser-Key Credentials_ from the _Google APIs console_ and wait some time to propagate.

After many months of development the app never had a problem, and we are sure we never removed such referrer (if it was ever there).

Anyway... it's done and learned.

(The solution was resolved under advice of email support after asking over StackExchange Firebase for support: http://stackoverflow.com/questions/42015155/firebase-authentication-partially-working-only-email?noredirect=1#comment71243882_42015155)

hi
i have same issue.
https://github.com/ammara121/programmer/issues/1
plz solve

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jteplitz picture jteplitz  路  3Comments

Leanvitale picture Leanvitale  路  3Comments

sharomet picture sharomet  路  3Comments

goekaypamuk picture goekaypamuk  路  3Comments

fisherds picture fisherds  路  3Comments