knox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sandeep More (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KNOX-895) pass cookies to websocket backend
Date Wed, 04 Oct 2017 15:41:01 GMT

    [ https://issues.apache.org/jira/browse/KNOX-895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16191449#comment-16191449
] 

Sandeep More commented on KNOX-895:
-----------------------------------

Hello [~unidevel] would you like the headers to be transmitted during handshake ?  I believe
this should be possible.   [Websocket RFC |https://tools.ietf.org/html/rfc6455] states that
cookies and headers can be passed during the handshake.

> pass cookies to websocket backend
> ---------------------------------
>
>                 Key: KNOX-895
>                 URL: https://issues.apache.org/jira/browse/KNOX-895
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>    Affects Versions: 0.11.0
>            Reporter: Zhou Li
>             Fix For: 0.14.0
>
>
> As a websocket user, I have a webapp which using both websocket and rest api, I want
to keep the authentication across websocket and rest api by using session cookies. 
>     I noticed in my browser, when I connect to websocket, the request does include cookies,
see the request information as below:
> Request URL:wss://9.30.109.105:8443/gateway/default/message-service/messages/topic?name=sqlEditor
> Request Method:GET
> Status Code:101 Switching Protocols
> Response Headers
> view source
> Connection:Upgrade
> Date:Mon, 27 Feb 2017 02:11:29 GMT
> Sec-WebSocket-Accept:KPpUPgOW3IZT9M9KlxRAn7JVBYQ=
> Upgrade:WebSocket
> Request Headers
> view source
> Accept-Encoding:gzip, deflate, sdch, br
> Accept-Language:zh-CN,zh;q=0.8
> Authorization:Basic YWRtaW46YWRtaW4tcGFzc3dvcmQ=
> Cache-Control:no-cache
> Connection:Upgrade
> Cookie:JSESSIONID=1balehb45f8z91drorxev1om1d
> Host:9.30.109.105:8443
> Origin:https://9.30.109.105:8443
> Pragma:no-cache
> Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits
> Sec-WebSocket-Key:gUYyWYAMCa6JbnJ4jNiVhA==
> Sec-WebSocket-Version:13
> Upgrade:websocket
> User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/55.0.2883.87 Safari/537.36
> But after knox connect to my backend, I didn't see the cookies from browser, here is
my log:
> Handshake headers=====================>Map(Cache-Control -> [no-cache], Connection
-> [Upgrade], Host -> [localhost:11080], Pragma -> [no-cache], Sec-WebSocket-Key
-> [kFoKOoeX09xaIUqOL+xykA==], Sec-WebSocket-Version -> [13], Upgrade -> [websocket])
> Could knox add support for passing cookies or maybe some headers to backend webscocket
upgrade request?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message