Invalid credentials error in Angularfire2 oauth login
<p>I'm trying to login to my Ionic 2 app using Facebook native and Angularfire2 (2.0.0-beta.2), but even though I am successfully getting an access token, no matter how I try to pass it in to angularfire's auth.login function it still throws an invalid credentials error.</p>

<p>Here is my config:</p>

<pre><code>firebaseAuthConfig({
   provider: AuthProviders.Facebook,
   method: AuthMethods.OAuthToken,
   remember: "default",
   scope: ["email"]
})
</code></pre>

<p>And here is my login function:</p>

<pre><code>login() {
Facebook.login(["public_profile", "email", "user_friends"])
  .then((success) =&gt; {
    console.log("Facebook success: " + JSON.stringify(success));
    this.af.auth.login(success.authResponse.accessToken, { provider: AuthProviders.Facebook })
      .then((success) =&gt; {
        console.log("Firebase success: " + JSON.stringify(success));
      })
      .catch((error) =&gt; {
        console.log("Firebase failure: " + JSON.stringify(error));
      });
  })
  .catch((error) =&gt; {
    console.log("Facebook failure: " + JSON.stringify(error));
  });
}
</code></pre>

<p>And here is the error I get in my console.log:</p>

<pre><code>Facebook failure: {"code":"auth/argument-error","message":"signInWithCredential failed: First argument \"credential\" must be a valid credential."}
</code></pre>

<p>It's interesting that it's being caught at the Facebook level instead of the catch I have set up for the auth.login.  I have tried passing it in several different ways including as an object <code>{ token: success.authResponse.accessToken }</code> and I'm at a loss now.  Can anyone help me see what I'm doing wrong? Thanks!</p>

<p>Also, I don't think this is related, but just in case it is I am also receiving a "operation has timed out error" that's not being caught but seems to be thrown by my this.af.auth.subscribe call. The app keeps running fine but perhaps that could be what's making the login fail?</p>