signInWithCredential error code auth/network-request-failed
Version info
Angular: 2.0.0-rc4
Ionic: 2.0.0-beta.35
Firebase: 3.3.0
AngularFire: 2.0.0-beta.2
Google plus sign in using signInWithCredential(idToken) .
var provider = (<any> firebase.auth.GoogleAuthProvider).credential(null,res.idToken);
firebase.auth().signInWithCredential(provider)
.then((success) => {
this.navCtrl.setRoot(TabsPage);
console.log("Firebase success: " + JSON.stringify(success));
})
.catch((error) => {
this.error = error
console.log("Firebase failure: " + JSON.stringify(error));
});
Google sign is sucessfull and idToken is received. But , it gives 404 (Not Found) on https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=<My-Api-Key> at firebase.auth().signInWithCredential() method.
Debug output
** Errors in the JavaScript console **
POST
https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=My-key 404 (Not Found) zone.js:101
Firebase failure: {"code":"auth/network-request-failed","message":"A network error (such as timeout, interrupted connection or unreachable host) has occurred."} app.bundle.js:254
Expected behavior
Should sign in into firebase using google sign in access token.
I'm not using angularfire but I am on firebase 4.4.0 and seeing this issue trying to use auth via with onAuthStateChanged and onIdTokenChanged listeners in election (an atom package specifically). I believe it was after adding the onIdTokenChanged listener and then closing my laptop and opening it up again a few hours later to see my screen flooded with this error. My guess is this has to do with my mac waking itself up periodically which establishes an internet connection but then going back to sleep which is confusing firebase.
the same issue, I'm using universal with angularfire 2
rejection:
{ [Error: The XMLHttpRequest compatibility library was not found.]
code: 'auth/internal-error',
message: 'The XMLHttpRequest compatibility library was not found.',
@hiepxanh "library was not found" is by no means the "same issue" as "auth/network-request-failed". Please submit a new issues.
Folks, this is a closed issue. Locking this issue to encourage value-add contributions over more "me too" and "does not work replies. Please open a new issue if you think you have done sufficient due diligence to show a bug with this lib, including specific errors/stacks/details and minimal repros with complete and minimal code/versions/sample data required to run them. Always include networking logs for issues like this as well.