Search code examples
angularjsfirebasefirebasesimplelogin

Angular Firebase simplelogin


When I use construction like

 ref.authWithOAuthPopup("facebook", function(error, authData) {
        console.log("User ID: " + authData.uid + ", Provider: " + authData.provider);
    }, {
        remember: "sessionOnly",
        scope: "email"
    });

All is working:

User ID: facebook:..., Provider: facebook 
User ID: google:..., Provider: google
.... and others.

When I use construction

 var authClient = $firebaseSimpleLogin(ref);
 authClient.$login("google", {
        remember: "sessionOnly"
    });

I see an error '400. That’s an error. Error: redirect_uri_mismatch'.


Solution

  • You have to properly set REDIRECT URIS in your Google Developers Console page.

    Go to https://console.developers.google.com/, authenticate (:-), select APIs & Auth, Credentials, and fill REDIRECT URIS field with the url https://auth.firebase.com/auth/google/callback.