2
votes

I'm migrating from Firebase 2 and AngularFire 1 to Firebase 3 and AngularFire 2. With Firebase 2 and AngularFire 1 I had all six auth options working: Google, Facebook, Twitter, Github, e-mail & password, and anonymously. Now with Firebase 3 and AngularFire 2 five auth options are working but Google OAuth refuses to work. I'm using $scope.authObj.$signInWithPopup("google"). The pop-up pops up but then there's an error message:

The redirect URI in the request, https://crudiest-firebase.firebaseapp.com/__/auth/handler, does not match the ones authorized for the OAuth client.

In my Google Developers Console I have the authorized redirect URI set to https://crudiest-firebase.firebaseapp.com/__/auth/handler. This is the URI that works for Facebook, Twitter, and GitHub, and it's the same URI that's in the error message.

This error message has persisted for several days.

Just to make it easy to compare:

https://crudiest-firebase.firebaseapp.com/__/auth/handler // rejected redirect URI https://crudiest-firebase.firebaseapp.com/__/auth/handler // redirect URI in console

Any suggestions why Google is giving me this error message?

1
Sometimes, it takes a couple of mins for the change to apply, make sure you add Authorized Javascript Origins and Authorized redirect URIs for your oauth 2.0 credential. Make sure you are using the same project for both. - bojeil

1 Answers

0
votes

Google's error message includes a project ID. The Google Developers Console has a project ID for each project. These two project IDs didn't match. When you create a project in the Google Developers Console you get a "Client ID" and a "Client secret." You can then enter or change these in the Firebase Console by selecting your project, then selecting "Auth" in the left column, then selecting the "SIGN-IN METHOD" tab, then select "Google," then click the arrow to open "Web SDK configuration (optional)." You'll then be able to change the "Web client ID" and the "Web client secret."