-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signInWithCredential error code auth/network-request-failed #581
Comments
How often does this occur? Every time? 10% of the time? How many attempts did you make and over white time period? Can you upgrade to the latest (currently 3.4.0) and try again? If it's still an issue, we'll probably need a jsfiddle or plunkr that reproduces this to be much help, and it's probably not AngularFire-related. |
I am getting the same behavior happen. But I don't know what do to put it on plunkr or jsfiddle. https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=MYKEYWASHERE Failed to load resource: the server responded with a status of 404 () XMLHttpRequest cannot load https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=MYKEYWASHERE. Response for preflight has invalid HTTP status code 404 R {code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred."} |
Damn, right after posting I decided to try loading the code in firefox instead of google chrome. I didn't have an issue! This is a Google Chrome issue. |
Nice! Well that's a useful note. It's at least a starting point for a fix. What's the minimal code needed to reproduce this? Can it be recreated with vanilla Firebase or only if AngularFire is involved? If we can whittle down the scope just a bit more, I can start looking for a solution. |
I have the following via localhost:8100: The login page has a click action called loginUser()
In firefox it works just fine. In google chrome (Version 53.0.2785.143 (64-bit)) Mac, it does not. |
Restart fixed the issue on google chrome. |
I actually updated my Ionic to final version of angular 2 and also updated angularfire2 firebase. The issue was not present in the updated version , so I couldn't reproduce it. Can be closed. I think update is the solution |
I am having the same with all updated libraries, but only on iOS native. Ionic 2.0.0-rc.1 User is being created, but methods are throwing exceptions, which makes it impossible to retrieve the user id. |
Hi,
I am posting how I fixed my issue here to hopefully provide a possible solution to someone who may be experiencing the same issue. I have 2 identical ionic projects with the same exact versions of the previously mentioned libraries. The prototype project with the working signInWithCredential which I use to develop new features and my main project. The code in the main project is an exact copy and paste of my previous project yet my main project was having this issue.
|
@ikabod-bubwit Try your fix and it is not helping on Chorme browser situation (I have not tested on iOs yet). Whitelist plugin is only in Cordova situation NOT in ionic server. I am in Ionic RC2 now and still same problem. The error show up like 80% of the time when hard refresh. Please help! |
Has anyone managed to solve this problem, I have the same problem in my ionic 2 app |
I am also getting this same issue. Any solutions?? |
I am facing this again ! Time to reopen I guess... |
I should note that this only happens when I have dev tools open in chrome. |
This is also an issue for me in Ionic RC4 using the latest firebase version |
I tried it twice , and can confirm we dont get this error on f So , use version 3.6.1 |
Still, does not work even with firebase 3.6.1. I tried running the app in Firefox or Edge and it worked nicely. I don't know what is causing this. |
angularfire2 dependency for firebase is v3.3.0 |
@dcinadr This really did the job mate, thanks a lot! |
For anyone using firebase and phonegap/cordova, I ran into the same issue. Using firebase version 3.6.1 fixed the issue for me. |
This happens for me too on Chrome, even if I'm using 3.6.1 of firebase. However, it works on firefox |
@dcinadr I don't think it has to do with angularfire, it has to do with firebase itself. I'm using react and still getting the error. |
[redacted] |
We do love feedback, and appreciate it. But please keep it civil, constructive and on topic. |
@apatton724 I can confirm this. I use with firebase#3.6.6, when using $firebaseAuth().$signInWithCustomToken on and Android app (6.0 and 4.4) I get the if you watch $firebaseAuth.$onAuthStateChanged you will see it fires twice when you use |
Can you reproduce the same behavior without AngularFire, by dropping to the Firebase SDK and running auth? |
also have the same issue, i tried this following :
using : |
I'm facing the same issue building Ionic2/AngularFire2 app and also with Ionic2/Firebase sdk. Those are my dependencies: Thanks to the folks here, I was able to fix it by downgrading to firebase@3.6.1 and now its working fine on android. |
I feel that the most stable Firebase version with angularfire2 beta8 is 3.4.0 |
I have meanwhile moved up to Ionic3/Angular4 and all is well except for having to keep Firebase |
+1 for rolling back to Firebase 3.3.0. I've been having a problem with intermittent connections to Firebase on Android devices. But rolling back seems to have resolved the issue. |
downgrade from 3.7.5 to 3.3.0 works for me. |
I've been trying to fix this ionic/firebase issue on my android device for 2 days straight. Worked great in browser but not on android device. Downgrading to 3.3.0 did the trick. If only I found this faster -__- Thanks! |
Hi, I'm also using ionic. I can reproduce this 100% of the time on my phone (also tested on Firefox and Chrome desktop, but never encounter this problem). From Android phone:
It should has nothing to do with the keyboard or input focus / refocus but I don't have any clue either. Finally I tried downgrading to 3.3.0 and it solved the issue. But this should not be an acceptable workaround. I think we should also try the recent Firebase SDK 4.0.0 and since it is open sourced it should be easier to debug (https://github.com/firebase/firebase-js-sdk). I will try and if the problem still persist I think we should open the new issue there. |
I have this issue with 0.5% of the user requests, which is low but that's a lot of users. (using |
+1 |
same problem here ... inconsistent and impossible to reproduce for now. |
Including the cordova-plugin-network-information corrected this issue for me. I confirmed that the 'navigator.onLine' was occasionally 'false', which I believe was causing Firebase to think there was an issue. Once I added the cordova-plugin-network-information to my project, the problem went away. I didn't dig deep into why, but I suspect this plugin has a better wrapper around the navigator which may be giving Firebase better information. I did confirm this problem came back after removing the plugin, but re-applying it fixes it. I will update this if I dig deeper. I hope this helps. |
@washowasho interesting, so in theory this should help: Object.defineProperty(navigator, 'onLine', {
get: function() { return true; },
set: function() {}
}); |
@washowasho THANK YOU SO MUCH!!! Solved it for me! |
Looks like this may have been solved in the latest release of Firebase 4.2.0. I'll be verifying when I get a chance. "Refactored to not use navigator.onLine for offline detection in Cordova environments." |
Seems like after I downgrade firebase to 3.3.0 it is resolved. Before this I was continuously getting 'auth/network-request-failed'. Let me know if there is solution for this in newer versions. |
i tried all above solutions but not works for me |
At some point later on I moved most versions up to latest and tried again and it now works. |
Unfortunately, it isn't. With 4.4.0, the problem is still there. I'm not using angularfire2, though. |
I confirm that it is not working with 4.4.0 but downgrading to 3.3.0 works for me |
I got it working by adding |
I have faced the same issue, and i tried most of the solution above (including downgrade to firebase 3.3.0 or add cordova-plugin), and none of them work for me. I'm currently using firebase 4.4.0. I was able to fix the problem by adding the line below in platform/android --> AndroidManifest.xml.
My firebase signin able to go through now after adding the line. Please try see if you can make it work. I not sure why the line is missing out at the beginning. I not sure if this is the best way of fixing it. But it should the easiest and fastest way (without downgrading or install plugin) |
I already had this permission in my app. Still, the logon did not work reliably. The only solution I found was to either add the plugin mentioned above or override |
Can you show the code you added regarding the network plugin and where you added it? I want to check it makes things more stable. Thanks |
It's this Cordova plugin: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-network-information/, but this would only make sense if you're building a Cordova application. What it basically does (that fixes the Firebase problem) is to override the navigator.onLine getter. You could achieve a similar "fix" with this code: Object.defineProperty(navigator, 'onLine', {
get: function() {
return true;
},
set: function() {}
}); But beware this overrides the standard The main reason why Firebase auth fails is that it relies on |
I'm not using angularfire but I am on firebase 4.4.0 and seeing this issue trying to use auth via with |
the same issue, I'm using universal with angularfire 2
|
@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. |
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)
.Google sign is sucessfull and idToken is received. But , it gives
404 (Not Found)
onhttps://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyAssertion?key=<My-Api-Key>
atfirebase.auth().signInWithCredential()
method.Debug output
** Errors in the JavaScript console **
Expected behavior
Should sign in into firebase using google sign in access token.
The text was updated successfully, but these errors were encountered: