-
Notifications
You must be signed in to change notification settings - Fork 13
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
Investigate 401 handling for WebSocket #39
Comments
|
The difficulty with preflighting auth via XHR or fetch is that the pywebsocket API doesn't support basic auth for plain HTTP except by restarting it with different command-line arguments. I had an idea yesterday that we can test this more easily by using the regular (non-WebSocket) wptserve, but returning a 404 after auth succeeds. We won't be able to tell whether it succeeded using the WebSocket API, but we can ask the server whether auth succeeded after the WebSocket onclose handler is called. Another trick I've used in the past is to return a canned WebSocket response containing only a close frame from an HTTP-only server. That's probably harder to understand than the 404 trick, however. I don't have time to dedicate to this at the moment, but I will try to fit it in. A case I'm particularly interested in trying is a digest authentication like this:
The idea is to get close to the multi-stage auth used by NTLM or Negotiate, without hitting the weird platform-specific behaviour that NTLM and Negotiate imply. |
Thanks, I don't think there's any particular rush, but that sounds like a good strategy (I was also wondering how this would work with web-platform-tests and did not think of that trick). We should also test @dveditz's scenario with differing realms. |
On Mon, Jun 18, 2018 at 2:08 AM Adam Rice ***@***.***> wrote:
The idea is to get close to the multi-stage auth used by NTLM or
Negotiate, without hitting the weird platform-specific behaviour that NTLM
and Negotiate imply.
@ricea I’m not sure I fully understand your point, but the above scenario
won’t get any closer than just doing basic auth, at least in Chrome. You
either do the weird (platform-specific) bits or you don’t do it at all, but
there’s no intermediate step you can get close to approximating.
|
@sleevi The part I'm interesting in exercising is handling more than one 401 response in the process of establishing a single WebSocket connection. I should have just said that explicitly, sorry. Obviously it would be better to test real multi-stage auth, but I know of no realistically achievable way to do that in the web platform tests. |
This is a follow-up to whatwg/fetch#565 and whatwg/fetch#761 (comment) in particular.
It'd be good to write more tests that cover the various scenarios:
fetch()
withAuthorization
before opening the web socket connection.Not sure all of those are easy to do in web-platform-tests given that authentication entries likely don't cross ports...
And review the algorithms in the standard again to ensure no prompting can take place ever (and maybe check again if implementations have the necessary bugs if they don't implement that).
The text was updated successfully, but these errors were encountered: