Qlik Community

Ask a Question

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
eschinea
Contributor II
Contributor II

Share Websocket-Browser Session

Hi,

Due to business requirements I need to connect a website to QlikSense Enterprise so users can select values either directly on Qlik or from that site. So far, I have connected QlikSense Enterprise to that website via Python and Websocket. So something similar to this:

Qlik - (Websocket) Python (API) - Site

My problem is that when python connects to Qlik via Websocket I get a new session even though the user has already an open session (Qlik opened on browser). Message from Qlik:

{"jsonrpc":"2.0","method":"OnConnected","params":{"qSessionState":"SESSION_CREATED"}}

This means that every modification the user makes via websocket will not be visible on the browser (different sessions). I have tried and read everything I could but I haven't found the way to create/share only one session per user, so all changes the user makes via the browser or websocket would be available to him.

I think one option could be sharing X-Qlik-Session cookie, but I have not succeed on this so far.

This is how I am opening the websocket connection:

:::python

self.ws = websocket.WebSocketApp(self.url, on_message=self.on_message, on_error=self.on_error, on_close=self.on_close, header={'X-Qlik-User: UserDirectory=XYZ; UserId=xyz'})

ssl_option = ({"ca_certs": "\\root.pem",
   "certfile": "\\client.pem",
   "keyfile": "\\client_key.pem",
   "cert_reqs": ssl.CERT_NONE,
   "server_side": False
   })
self.ws.on_open = self.on_open

self.ws.run_forever(sslopt=ssl_option)

I'd appreciate any help or hint on this.

Thanks in advance!

3 Replies
lindybrits
Contributor III
Contributor III

Hi Ismael

I was wondering if you ever cracked this? I want to do the same thing, but via a WebSocket connection from Node.js.

KInd Regards,

LIndy Brits.

bentotdecruz2
Contributor II
Contributor II

Hi Ismael,

How did you manage the login part?  Does your site has its own login page or you login in Qlik url in another tab that's why you're able to get the session?

Thanks,

Ben

beatYesterday
Contributor III
Contributor III

Has anyone figured out a way to do this?  I'm encountering the same problem.