This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Basic auth and websocket #158
Comments
Wow, that is indeed a glaring hole in the WebSocket spec from what I can tell. Does this problem go away if using |
Here's a code snippet that strips the authorization: https://github.com/sindresorhus/strip-url-auth/blob/master/index.js |
Would it make sense to perform that stripping logic here and anywhere else a URL is logged in the client? |
Sounds good to me. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Not sure if this can or should be addressed here, but worth a quick convo. I'm running a notebook or kernel gateway server behind nginx with basic auth configured.
I can tell programmatically auth HTTP requests made by jupyter-js-services using the ajaxSettings. But the parameters don't apply to Websocket connections (in NodeJS
ws
at least, and browser behavior seems ill defined).I can hack around this problem by passing a
wsUrl
parameter containing the auth parameters in the canonical URL format:This works, but the the client log message about the websocket starting contains my password:
Simple fix: don't log the whole websocket URL in case there are creds in it. Harder fix (but less hacky): figure out how to map appropriate ajaxSettings (headers? basic auth?) to the equivalent parameters supported by the environment's Websocket API.
The text was updated successfully, but these errors were encountered: