motor-ui icon indicating copy to clipboard operation
motor-ui copied to clipboard

Need change in Config parameters to log into Qliksense Enterprise Edition

Open kswamy15 opened this issue 3 years ago • 7 comments

The current config parameters only allow logging into Qlik Cloud environment. Qlik Enterprise edition log in requires a few other parameters. How to make those changes? Cloning repository and npm run build with changes doesn't work - npm run build fails on motor-ui. Errors like ../motor-ui/src/lib/components/visx/components/axis/BaseAxis.tsx(49,24): semantic error TS2554: Expected 3 arguments, but got 2. src\lib\components\visx\components\axis\BaseAxis.tsx

I can make changes and request a pull. Not sure how @motor-js/core works when the repository is named motor-ui

kswamy15 avatar Mar 10 '21 01:03 kswamy15

Hey,

Please give me some more details about your set-up and I can advise:

How is authentication handled on your Qlik Sense site? Are you hosting on the server or externally? What additional parameters are you referring to? - like loading certificates or similar?

Thanks, Luke

lureilly1 avatar Mar 10 '21 08:03 lureilly1

npm run build should now work fine

lureilly1 avatar Mar 12 '21 10:03 lureilly1

We couldn't connect to QlikSense Enterprise using JWT or certificates from a react app. using a JWT token requires sending a header in the Websocket. You can't send a header in a client Webapplication - you can send a header if you run the .js file using the node command. Finally was able to connect using the Engima.js example application where they use the redirect.html in the host name - see here https://github.com/qlik-oss/enigma.js/tree/master/examples/complete/car-models. You have to upload the redirect.html to the Default content library in Qliksense qmc.

Essentially we had to modify the useEngine.jsx to include these lines: const reloadURI = encodeURIComponent(${location.origin}/content/Default/redirect.html); const url = ${location.origin.replace(/^http/, 'ws')}/app/engineData?reloadURI=${reloadURI}; also use this session.on for authentication: session.on('notification:OnAuthenticationInformation', (authInfo) => { if (authInfo.mustAuthenticate) { location.href = authInfo.loginUri; } I am giving this detail so that it could help others to connect to Qliksense Enterprise. You could also make a change in the library to accomodate this. I can make the appropriate and post a pull request - you could see my code and decide on how best to accomodate these changes.

kswamy15 avatar Mar 12 '21 21:03 kswamy15

Great, thanks for this. I'll create a branch and implement this into the main library. I'll probably add a new prop to accommodate for this additional log in type.

Worth noting that you can pass the engine object directly to the Motor component. So potentially you can connect via node.js, grab the engine object and pass this to the Motor component in your React app.

lureilly1 avatar Mar 15 '21 12:03 lureilly1

I runned the starter locally and it works! But when I deploy it on Netlify the Websocket connection fails.

https://6078dc30aca5fadfaeaad644--laughing-mccarthy-d3be37.netlify.app/

Hey, please can you post your config object and the motor-js version you are using.

lureilly1 avatar Apr 18 '21 19:04 lureilly1

export const config = {
//Enter your app config here..
  host: 'qap.sebrae.com.br',
  secure: true,
  port: 443,
  prefix: '',
  appId: 'd183a25e-de1d-47a0-b2a0-459dfbbc20d1'
 
};

Version of motor: 0.1.8