Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
norberto5flores
Partner - Contributor II
Partner - Contributor II

How to get objects from Qlik Sense

Hello there,

We are developing a web site using Asp.Net framework that can communicate with Qlik. What we need is to get Qlik objects to show them in our frontend. I decided to use SDK for Qlik.

Im testing a sample code from gitub to connect via virtual proxy with anonymous user.

norberto5flores_0-1641836159512.png

 

I configured the virtual proxy with "anonymous user" and linked to central proxy

norberto5flores_1-1641836301933.png

norberto5flores_2-1641836585292.png

 

When running the code it throws an "Unable to establish WebSocket connection." error.

What am I doing wrong? Am I missing something?

Notes:

  • Qlik Sense and Asp.Net development are on different servers
  • There are firewall rules that allow inbound/outbound connections to the Qlik sense server, indeed I can open the sense hub via a web browser 
  • Ip public address from the development server is added to the virtual proxy white list
  • I know there is an embedded option but when I use that one it shows a login "modal" and I don't want to log first in to my web site and then in Qlik, It must log in to my website and then I log them in Qlik
Labels (2)
16 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Actually...if you authenticate with AsDirectConnection, you are connecting to the Qlik Engine, not the proxy.  It may be that authentication required to embed visualizations, e.g. Single Object or Capabilities API, would require that you be authenticated to the Proxy.  Which means you would need to use a connection method that connects to the proxy, eg AsNtlmUserViaProxy.  Again, I'm going to ask @Øystein_Kolsrud to confirm my thinking on this. 

-Rob

Øystein_Kolsrud
Employee
Employee

Yeah, I think @rwunderlich is right here. What you need is a session cookie. That is what you want to pass to the browser as that is what conveys the authentication information for the Proxy. But when you do a direct connection to the engine using certificates, then there is no session cookie in play. Instead in that scenario, it's the certificates (along with the user header) that convey the authentication info.

So what you probably want to do here is to have the user connect to the proxy (for instance using AsNtlm), then pick up the resulting session cookie and pass it on to the mashup. The session cookie can be accessed through the "ILocation" object:

SessionCookie Property

norberto5flores
Partner - Contributor II
Partner - Contributor II
Author

I was able to authenticate using AsNtlmUserViaProxy and get session cookie, now how can I pass it to the embedded mashup?

My url to get the visualization is:

https://x.x.x.x/extensions/View_Object/View_Object.html

Note: This url I got it from dev-hub, inside options in the mashup list (an option called "View") 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

This is where you may get more specific answers on the slack channel.  You'll need to associate the session cookie with the x.x.x.x domain.  Maybe @websy1985 or @Jeffrey_Goldberg can advise?

-Rob

norberto5flores
Partner - Contributor II
Partner - Contributor II
Author

I have tried to send session cookie has a parameter in the url like this https://x.x.x.x/extensions/View_Object/View_Object.html?X-Qlik-Session=123 but login modal still appears.

While I was trying to debugging I came to realize that iframe's url send and parameter called qlikticket once I am authenticated with the login modal, then I suppose the real thing I need to do is to generate a ticket and then send it as a parameter instead of session cookie?

norberto5flores
Partner - Contributor II
Partner - Contributor II
Author

The solution for this was to get a ticket from proxy API and sent it as a parameter on the embedded visualization.

I used a code example from  Connecting to the QPS API using certificates to do a ticket request to Qlik and then I covered the response to the .net Model so I can get the ticket string as a property:

norberto5flores_0-1643233269887.png

In addition to this, I want to say I couldn't generate tickets using postman or PowerShell examples found on the Qlik knowledge base

Thank you very much for your time and information

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Thanks for updating us. Glad you got it to work!

-Rob