Angular 1.5 + AngularFire + Firebase V3 + Facebook Auth = Trouble

216 views
Skip to first unread message

easyapps...@gmail.com

unread,
Jun 20, 2016, 10:12:20 PM6/20/16
to Firebase Google Group
Started a project with firebase v3 and angularFire to auth users but things gone trouble. Sometimes I'm getting error "the server responded with a status of 400 (HTTP/2.0 400)" or the error is not showed and the promise $signInWithPopup is not resolved. Following my configs and the auth method:

Config:

        <script>
          // Initialize Firebase
          var config = {
            apiKey: "#########",
            authDomain: "easyapps-3639d.firebaseapp.com",
            databaseURL: "https://easyapps-3639d.firebaseio.com",
            storageBucket: "easyapps-3639d.appspot.com",
          };

          firebase.initializeApp(config);
        </script>

Auth Method:

var auth = $firebaseAuth();
var provider = new firebase.auth.FacebookAuthProvider();
provider.addScope('public_profile');
provider.addScope('email');

// login with Facebook
auth.$signInWithPopup(provider).then(
function(firebaseUser) {
console.log("Signed in as:", firebaseUser.uid);
$state.go('app');
}
).catch(function(error) {
console.log("Authentication failed:", error);
}).finally(function(e){
console.log("Authentication finally:", e);
});

Can anyone help me?

Jacob Wenger

unread,
Jun 21, 2016, 2:52:48 PM6/21/16
to fireba...@googlegroups.com
Hey there,

Nothing in your code pops out as wrong to me. Can you please put together a minimal repro using JSFiddle or Plunkr that we can use to debug live? Are you trying to access this from a local server or an actual website? Have you made sure you've updated your authorized OAuth domains to include the URL you are trying to authenticate from?

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/7cb05881-3dd1-4def-bd29-1d2ee2a8e823%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bassam Ojeil

unread,
Jun 21, 2016, 5:11:29 PM6/21/16
to Firebase Google Group
Hey easyapps,
You said you are getting a 400. Can you check your network tab in the console and provide us with more detailed information regarding the request that is failing?

Bassam
Reply all
Reply to author
Forward
0 new messages