4
votes

After months of developing a Web App under Firebase suddenly these days we have a problem with the Authentication, it returns this console.alert only with Facebook and google login (email/pass login works fine):

[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 (front.qualify.mx) to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.

The App uses 3 different sub-domains, and in all 3 we can access over email/pass but not Facebook nor google. We tried updating the Firebase initialization script, nothing. We have checked the API keys (in the Google APIs Credentials) and there was a new "Server key (auto created by Google Service)" which no one told us it was generated (Jan. 18th), so we edited it to include the domains as the original API key in different ways (w/wo * and /*), nothing. We deleted this new Server Key, suddenly something different, now the console includes a 403 error before the alert stated above and returns auth/timeout code inside the object.

We also found the Identity Toolkit API has detected many errors, so we tried to add the URLs for login, logout and email, but nothing happens when trying to save.

What are we missing?

2
It sounds it's best to reach out to Firebase support for personalized help in troubleshooting. It's going to be hard to help here without an MCVE. - Frank van Puffelen
I've created a very simple MCVE to make the test (based on Firebase Tutorial Auth Files), this three links use the same App where I'm having the trouble, I've just added the domain to the Browser Key and you can verify they are all using the same init script: email , facebookRedir and GooglePop. Only Email works. - DavidTaubmann
Facebook and Google authentication both use OAuth, which requires a cross-domain postback. To do that securely, you need to set the correct domain in your Firebase Authentication console. Email/password works, because there is no cross-domain postback needed. To set up the domain, see stackoverflow.com/questions/37671742/…. - Frank van Puffelen
Yep, they've always been there, just rechecked... We even deleted and reinserted them in the tests in the morning... nothing changed. I hope the support team can find what's the problem. - DavidTaubmann
Hmm.. Still no answer from support... I believe I should make a test from scratch using a new firebase app. Nevertheless... basically the same config is being used in my old Firebase Tutorial Auth Files, and those still work fine. - DavidTaubmann

2 Answers

7
votes

The solution 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.

0
votes

The simple way I was able to solve this issue I had with my ionic project was by following the instructions in the log, if you don't see any message try console log the response from firebase.

So what I simply did was follow the url: https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project='projectId'

*projectId = the Id of your project

and enable the Identity API something it brought up. Finish, and it worked instantly.