-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Authentication fails since 0.8.6 - CORS #333
Comments
The client needs to set an additional flag to allow passing cookies with CORS, as "documented" here, and I assume also in the actual spec. http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ (search in page for "cookie") |
My concern is that withCredentials doesn't seem to be supported cross browser. "By default, “credentials” such as Cookies and HTTP Auth information are not sent in cross-site requests using XMLHttpRequest. In order to send them, you have to set the withCredentials property of the XMLHttpRequest object. This is a new property introduced in Firefox 3.5 and Safari 4. IE8′s XDomainRequest object does not have this capability." The check for withCredentials support happens in hasCORS (https://github.com/LearnBoost/socket.io-client/blob/master/lib/util.js#L348) but it doesn't get set to true before the request. I'll try that now. |
I get this error after setting withCredentials = true; "XMLHttpRequest cannot load http://redacted/socket.io/1/?t=1320788664255. Cannot use wildcard in Access-Control-Allow-Origin when credentials flag is true." |
Working now. This should be fine since it happens after verifyOrigin: https://github.com/gavinuhma/socket.io/commit/e4a9342e8b029d8dc251f13b6320500e809c7921 |
FYI this bug is present in 0.8.7 too (just mentioning this since it might not be obvious to all users). Hope that 0.8.8 will include this fix. |
I have the same issue. i tried some fixes but they don't work :( |
Related issue for Tornadio2: |
I'm not sure if anyone who was having problems with this were using the auth technique described here (or nearly identically here) in a cross-domain environment. This ticket involves CORS, and the referenced socket.io ticket that was identified as the cause of this issue describes the cookie-based auth technique, so I'm assuming it's a common confusion. I think socket.io is working properly. Setting |
Cookies are not being sent so authentication fails.
This issue was original added to socket.io server by @renajohn: socketio/socket.io#625
I did a git bisect which tracked it down to this commit:
ab60690
Working request:
Broken request (Origin header / no Cookie header):
The text was updated successfully, but these errors were encountered: