Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.
Hi,
I'm trying to get authenticated user outside qlik sense using enigma.js and my code displays error like,
For your kind information, I'm already logged into qlik sense.
My code:
const enigma = require('enigma.js');
const schema = require('enigma.js/schemas/12.20.0.json');
const SenseUtilities = require('enigma.js/sense-utilities');
const config = {
host: 'Host.Name.Com',
secure: true,
port: 443,
prefix: "/Proxy prefix/",
};
const url = SenseUtilities.buildUrl(config);
console.log(url);
const session = enigma.create({ schema, url,
listeners: {
"notification:OnAuthenticationInformation": ( authInfo ) => {//notification:
if ( authInfo.mustAuthenticate ) {
location.href = authInfo.loginUri;
}
}
}
});
session.open().then((global)=>{
global.getAuthenticatedUser().then(user => console.log(user));
});
Any help?
what am i doing wrong? please suggest.
Thanks,
Bhargav Patel