Comments (6)
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/
from enigma.js.
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!
from enigma.js.
@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)
from enigma.js.
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
from enigma.js.
@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
from enigma.js.
@jlmelb just to confirm that the above approach is working fine. Here is a simple Svelte repo that demonstrate it
from enigma.js.
Related Issues (20)
- Enigma js connection failed in new chrome browser HOT 11
- Error: Session suspended while connecting Qlik one environment but it is working other environment
- Remove/update link for schemas when API Insights is removed
- Unable to close app HOT 2
- Qlik Saas blocking websocket connections from origins not the tenant HOT 6
- Npm update - schema 12.936.0.json is missing HOT 1
- Remove dependency to after-work.js
- Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid. HOT 2
- Question: How can I get the sheet name by passing the sheet id HOT 1
- flaky test `qix-logging` > `should log qix traffic`
- Incorrect Result for getHyperCubeData when using Master Measures in Viz Expressions HOT 8
- multiselect using enigma HOT 1
- Property 'openDoc' does not exist on type 'IGeneratedAPI HOT 5
- OnMaxParallelSessionsExceeded HOT 1
- upgrade to rollup v3
- Action Required: Fix Renovate Configuration
- TypeScript Support Broken HOT 2
- getDocList in Qlik Cloud instance HOT 2
- No use of providing appId to enigma session creation?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enigma.js.