Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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)
1 Solution

Accepted Solutions
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

View solution in original post

16 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I believe Anonymous Access requires a license that supports it. If you have just standard user licenses, Anonymous is not supported. Could that be the case here?

https://help.qlik.com/en-US/sense-admin/November2021/Subsystems/DeployAdministerQSE/Content/Sense_De...

-Rob

norberto5flores
Partner - Contributor II
Partner - Contributor II
Author

Ok, now it makes sense, thank you for your help 

And what can I do if I still want to get objects but with standard user license?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I believe your comment mentioned that you successfully connected using AsNtlmUserUsingProxy.  You can continue to use that. My preferred method is AsDirectConnection using certificate. But it depends on what you want to do.  When you say you want to get some objects and show them, do you mean you want to get the html and display them in your page?  I don't think the SDK provides any methods to get the html stream for objects, but there are other approaches such as the single object API.  Not sure about this, I'll ask @Øystein_Kolsrud to fill you in on the best techniques for reusing visualizations in ASP.NET app.

-Rob

Øystein_Kolsrud
Employee
Employee

As @rwunderlich correctly states, it's not possible to access any visualization HTML through the SDK. The SDK provides access to the engine API, and all the rendering of visualization is handled by the client. You might want to have a look at this page for options on how to integrate Qlik visualizations in other applications:

norberto5flores
Partner - Contributor II
Partner - Contributor II
Author

Thanks for the answers, I decided to use mash up editor as a test to see if It shows visualization and how it does.

Visualizations are embedded without a problem, but login is required to show them. 

Is there a way to take that login modal out? or another way to log that user does not get noticed (without login modal)? or do I need another approach to accomplish that?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You'll still need to authenticate as a user. Don't go down the road of thinking you can authenticate as the same user everywhere. There is a 5 session limit per userid 🙂 

You can authenticate on a different proxy that flows more to your liking. Or authenticate using sdk code or enigma.js, as long as the session cookie gets written to the browser it should pass through from the mashup. 

I'm sure there are other folks who could give you more specific examples. Another great place to ask for advice on these kind of questions is the Qlik Dev slack https://qlikdeveloper.slack.com/

-Rob

norberto5flores
Partner - Contributor II
Partner - Contributor II
Author

So, you are telling me that I can authenticate using SDK and then use embedded visualizations without the need to authenticate again (with that login modal)?

When you say "You'll still need to authenticate as a user. Don't go down the road of thinking you can authenticate as the same user everywhere. There is a 5 session limit per userid", does that mean I need more than one account to authenticate or is there a way to show visualizations without authentication?

And I couldnt enter https://qlikdeveloper.slack.com/ where can I create an account in here?  

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

So, you are telling me that I can authenticate using SDK and then use embedded visualizations without the need to authenticate again (with that login modal)?

Conceptually, yes. Authentication ultimately creates a X-Qlik-Session cookie in the browser. As long as requests for the visualization contain this cookie, authentication won't be required again. 

There is a 5 session limit per userid", does that mean I need more than one account to authenticate or is there a way to show visualizations without authentication?

Each separate browser counts as a session. You will need each user of your app to authenticate with their own credentials.  Or a pool of ids that don't exceed 5 sessions each.  There is a way to show visualizations without authentication, it's the Anonymous access you started this thread with.  That's a licensing thing, reach out to your Qlik account team to find out how to get such a license. 

Here's the invite link to qlikdeveloper. Try that.

https://join.slack.com/t/qlikdeveloper/shared_invite/zt-cqbt2jy9-_Vh9sL6VbgqtUcgGZgpp7g

-Rob

norberto5flores
Partner - Contributor II
Partner - Contributor II
Author

Ok, thank you so much for your time, first of all I will try to authenticate using AsDirectConnection and try to talk with my team about anonymous access account