Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rbartley
Specialist II
Specialist II

Enabling exportData for anonymous users from mashup

Hello everyone,

We would like to allow anonymous users to be able download data from our visualizations in a Qlik Sense mashup but I have seen in discussion Example of using exportData method that this is disabled by default.  Is there any way to achieve this as I would have thought that this is a fairly common requirement?

Thanks in advance.

1 Solution

Accepted Solutions
Alexander_Thor
Employee
Employee

Sure, instead of anonymous users you could fake a user and log that one in I guess.
Depending on how you deploy your sites solutions might change but usually ticketing is a fairly common scenario.

You would build a server side component that generates a ticket for the "user" and then you would consume said ticket from the client and thus logging them in.

Ticket ‒ Qlik Sense

View solution in original post

14 Replies
Alexander_Thor
Employee
Employee

Hey Richard,

Currently exporting for anonymous users is not supported.

There is however a current feature request active to deliver this into the product in the upcoming releases.

rbartley
Specialist II
Specialist II
Author

Hey Alexander,

Thanks for the response.  I have found that, even though I have rootadmin access I can only export data from my mashup when I have already logged on to the devhub by using the log in button.  Is there a way of avoiding having to do this?  For example, is it possible to automate the login?

Thanks in advance,

Richard

rbartley
Specialist II
Specialist II
Author

Hello Alexander,

Do you have a response for me regarding a possible workaround?

Best regards,

Richard

Alexander_Thor
Employee
Employee

Sure, instead of anonymous users you could fake a user and log that one in I guess.
Depending on how you deploy your sites solutions might change but usually ticketing is a fairly common scenario.

You would build a server side component that generates a ticket for the "user" and then you would consume said ticket from the client and thus logging them in.

Ticket ‒ Qlik Sense

rbartley
Specialist II
Specialist II
Author

Thanks Alexander, I'll take a look.

rbartley
Specialist II
Specialist II
Author

Alexander,

I have read the "Add a ticket" reference but the documentation does not provide a complete example of how this can be implemented within a server component. Could you please explain in basic terms the elements of such a component, where it should reside and how it should be incorporated into the default server architecture?  If you have any examples, that would be even better.

Thanks for your help.

Regards,

Richard

Alexander_Thor
Employee
Employee

Sure,

The server component would request a ticket from the Qlik Sense Proxy API using the certificates from the Qlik Sense services to sign it's requests. The ticket request will contain the user directory, user id and any additional properties that the user might have (used in access control).

The QPS will see the request and since it's signed by our certificates we will trust your component and issue a ticket for the user that you passed us.

Your server component will now send the ticket back to the user requesting the page. The ticket is consumed by fetching a resource from behind the proxy with qlikTicket=<ticket value> appended to the URL which will return a session cookie and the resource, for example require.js in a mashup scenario.

How you achieve this is up to you, if you render templates on the server then it would be easy to just append that to the initial load of require. You could also do that logic client side, find out if you are logged in and the api is loaded otherwise request a ticket and then fetch the entry point to the client apis.

If you go to Qlik Branch and search for authentication there are a few getting starting projects and other examples of authentication modules.

rbartley
Specialist II
Specialist II
Author

Hi Alexander,

I have made some progress with this and have followed the steps in this Qlik video on ticketing using Node.js:

https://www.youtube.com/watch?v=NHa7IvtHV2A

When I open up a browser session directly on the server where node.js and QAP are installed, and use the prefix I specified in the virtual proxy Identification section, everything works as expected and I am re-directed and authenticated using the userid specified in the authentication file that I have set up on port 1337.  However, when I attempt to repeat the process from a browser on my PC, it attempts to re-direct me to localhost.  I have tried replacing the Redirect URI with the full name of the QAP/Node server, but this just hangs and eventually times out (and it no longer works when repeating directly on the QAP server).  Any idea what I'm doing wrong or if it's a server config issue?

Regards,

Richard

rbartley
Specialist II
Specialist II
Author

....

When I say: "However, when I attempt to repeat the process from a browser on my PC, it attempts to re-direct me to localhost".  What I mean is that it appears to be trying to re-direct me to the localhost on my PC rather than the localhost on the QAP server (which is what I would have expected).