Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upCan not login with Facebook on Safari #191
Comments
This comment has been minimized.
This comment has been minimized.
After updating to the latest libraries and setting the correct cookie password length it still gives the same error:
|
This comment has been minimized.
This comment has been minimized.
P.S. this is my configuration:
|
This comment has been minimized.
This comment has been minimized.
I got a bit further, so when I add the mode: 'try' option, and of course reply if we are not authenticated then it shows this in the url bar:
|
This comment has been minimized.
This comment has been minimized.
@ldesplat could you maybe help with this? Seeing that this issue is currently blocking my production environment and I got a deadline coming up monday. |
This comment has been minimized.
This comment has been minimized.
Alright, looks like I can recreate the issue in Safari. Looks like it worked in Chrome & Firefox. Gotta figure out what changed in Safari and why it does not like our cookie to keep it around. |
This comment has been minimized.
This comment has been minimized.
I am using Safari v9.0.3, wonder if it worked on previous versions 8? |
This comment has been minimized.
This comment has been minimized.
I will ask someone who still got an older safari to try and login using facebook, I'll let you know asap |
This comment has been minimized.
This comment has been minimized.
I've downgraded to Bell v6.3.0 and see the same issue. What's funny is that if it fails the first time, then re-enter the url and it will work.... :( seems to especially break when you have to explicitly login rather than being automatically redirected (when you are already logged in through facebook). Re-created it through chrome once as well but cannot do it anymore. Cannot re-create with firefox at all (which sucks because it has best developer tools IMO) |
This comment has been minimized.
This comment has been minimized.
Indeed, I have noticed that too. But it is kinda critical since a new user will encounter it. Could it have anything to do with Facebook? Since every time I try to login with fb it first shows a warning: Cookies not enabled, so I try again and get logged in on their site. Then I get the error of token not found in the backend. Now maybe it has something to do with a failover storage of Facebook login? Maybe localstorage?? (not sure) |
This comment has been minimized.
This comment has been minimized.
P.S. Just got word that it is not working on safari 5.1 either the first time, after that it works |
This comment has been minimized.
This comment has been minimized.
Just when I disabled my developer accounts with Google. Gotta check if it happens with another provider... |
This comment has been minimized.
This comment has been minimized.
I cannot recreate anymore, no matter how many times I clear all my cookies and storage. Did it get fixed? |
This comment has been minimized.
This comment has been minimized.
It is not fixed yet, I can still replicate it (I do use incognito mode however every time I test it), since cookies do not always clear correctly + I think 302 redirects get cached |
This comment has been minimized.
This comment has been minimized.
@ldesplat Any progress? Since I still couldn't find any solution for this :/ and I really need it working. @hueniverse do you have an idea what the cause of this problem could be? |
This comment has been minimized.
This comment has been minimized.
No idea. |
This comment has been minimized.
This comment has been minimized.
Safari has very strict content security policies so depending on how you are doing your redirect it will not submit the cookies. There are a couple of workarounds, the simplest of which is described here zotonic/zotonic#902 (comment). |
This comment has been minimized.
This comment has been minimized.
Thank you @tkh44 That makes a lot of sense. I'll probably look this over the weekend. If you need this earlier, I'll gladly accept a PR. |
This comment has been minimized.
This comment has been minimized.
Could this perhaps be related to the |
This comment has been minimized.
This comment has been minimized.
I Tried adding the Origin header but that didn't fix it :/ Also don't got the time right now to look into it deeper since I got a deadline coming up. If I have the time I'll look into it. |
This comment has been minimized.
This comment has been minimized.
Any update? @ldesplat |
This comment has been minimized.
This comment has been minimized.
Hmm, this is a serious issue hurting us pretty bad. We are not able to add Fb login feature from several weeks only due to this issue. Could you please look into this? |
This comment has been minimized.
This comment has been minimized.
I am swamped at the moment, but I will be very happy to accept a PR from anybody in the community. The solution has been laid out earlier in the conversation. I'll get to it as I can for now but I will be very happy to make a new release with a contribution. |
This comment has been minimized.
This comment has been minimized.
@thebillkidy @gouthamve I've tried recreating it, and this time I really cannot anymore. I cleared all cookies, restarted browser, even using private sessions. I really am unable to re-create it. If you are, then I suggest you try the following bug fix:
That should fix it. But since I am unable to reproduce it with firefox/chrome/safari after deleting cookies and using private sessions, there's not much I can do to verify that it's working correctly. It looks like a simple fix, so if you are able to constantly reproduce it. Please submit a PR with a fix that works! Thank you! |
This comment has been minimized.
This comment has been minimized.
Can you confirm you cannot reproduce as well? I've tried again today and could not. If you are able to reproduce please contribute back a fix. Nothing I can do otherwise. I've described a potential solution so feel free to attempt and ask questions. |
This comment has been minimized.
This comment has been minimized.
Hi, Sorry for the late response. This bug is still there and I am still unable to fix it. It happens in very rare cases and replicating it consistently is hard. Around 5% of the testers that I used (different people) still had this problem. |
This comment has been minimized.
This comment has been minimized.
Error:
|
This comment has been minimized.
This comment has been minimized.
Ok current update, with this code it works in Safari and the problem can not be reproduced anymore. I will make a PR as soon as it has been tested for a bit. if (!state) {
if (request.query && request.query.refresh === 1) {
return reply(Boom.internal('Missing ' + name + ' request token cookie'));
} else {
var url = request.connection.info.protocol + '://' + request.info.host + request.url.path + '&refresh=1';
return reply('<html><head><meta http-equiv="refresh" content="0;URL=\'' + url + '\'"></head><body></body></html>');
}
} |
…browsers, fixes hapijs#191
This comment has been minimized.
This comment has been minimized.
Your fix is now in 7.6.1 with some modifications. Let me know if this does it. Thank you very much. |
This comment has been minimized.
This comment has been minimized.
Ok, so we tested it again on all major browsers, different operating system. The bug can not be reproduced now on where it appeared earlier, we however had some problems on a Windows Surface tablet, but this might be due to my implementation on the client side. |
This comment has been minimized.
This comment has been minimized.
Thank you for all that effort! |
This comment has been minimized.
This comment has been minimized.
We are experiencing this with Bell 10.0.0 |
Hi,
So when logging in with Facebook on safari I get the error message as stated below, now when I try this in other browsers it works: