Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to connect to Qliksense Enterprise from the browser #891

Open
gangataarun opened this issue Sep 9, 2021 · 6 comments
Open

Comments

@gangataarun
Copy link

Hi,

I'm building a qliksense mashup using React. I can authenticate and connect to the SaaS version of qliksense and would now like to connect to the Enterprise version of qliksense. How can I authenticate and connect from the browser? Would that be possible and how?

@countnazgul
Copy link

The general idea is quite similar to the SaaS.

  • try to establish connection
  • if unauthenticated - redirect the user to the login page
  • qlik redirects you back to the web app with qlikTicket in the url
  • open connection and pass the ticket as url param in the engine connection string

Just published a post about it and saw your question :)

https://sstoichev.eu/2021/09/09/qseow-authentication-svelte/

@jlmelb
Copy link

jlmelb commented Nov 26, 2021

Thanks @countnazgul. Using your code, we have managed to authenticate and use enigma to connect to one of our apps.

Our issue now is that we need to close the enigma session and create a new session to access a second app. Is there a way to do this without having the user to re-authenticate via the login page? We are thinking whether there is a session cookie that we can pull back but would love some guidance!

@countnazgul
Copy link

@jlmelb i havent tested it myself but ...

You can use the ticket to access some protected resource (like an image or css file). Once the request is completed Qlik will send the session cookie and the browser will set it. After that you can connect to the engine (without applying the ticket in the web socket url)

@jlmelb
Copy link

jlmelb commented Nov 29, 2021

Thanks @countnazgul

When we tried to use the ticket to access a resource for example the QS require.js or style sheets, we are greeted with a status code of 302 Authenticate at this location. Would this because the ticket has already been consumed by enigma via the execution of enigma.create() when returning to the browser with the ticket?

Example URL for accessing protected resource: https://host/resources/autogenerated/qlik-styles.css?QlikTicket=TicketString

@countnazgul
Copy link

@jlmelb yes. once the ticket is consumed it can't be used again. So what you can try is:

  • try to open enigma connection. if its successful then all good
  • if not successful then redirect the user to login
  • once redirected back (after successful authentication) use the ticket the grab some file (qlik-styles.css in your case)
  • once/if this is done try and open the engima connection again

Just to mention again that i havent tried this myself. If i have the time will try it

@countnazgul
Copy link

@jlmelb just to confirm that the above approach is working fine. Here is a simple Svelte repo that demonstrate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants