<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Qlik Engine JSON API - authentication in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qlik-Engine-JSON-API-authentication/m-p/1616072#M45855</link>
    <description>&lt;P&gt;Hi, I need to get a list of the apps through an external development. I tried to do it with "Qlik Engine JSON API" using websockets in nodejs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const WebSocket = require ('ws');

// Set certPath to the path to the directory that contains the exported client certificates in PEM format.
var certPath = path.join ('C:', 'ProgramData', 'Qlik', 'Sense', 'Repository', 'Exported Certificates', '.Local Certificates');

var certificates = {
cert: fs.readFileSync (path.resolve (certPath, 'client.pem')),
key: fs.readFileSync (path.resolve (certPath, 'client_key.pem')),
root: fs.readFileSync (path.resolve (certPath, 'root.pem'))
};

// Open a WebSocket using the engine port (rather than going through the proxy)
// We use the certificates and a built-in Qlik service account
// We connect at the global level, which gives access to APIs in the Global class

const ws = new WebSocket ('wss: //server.domain.com: 4747 / app /', {
ca: certificates.root,
cert: certificates.cert,
key: certificates.key,
headers: {
'X-Qlik-User': 'UserDirectory = internal; UserId = sa_engine '
}

});

ws.onopen = function (event) {
// send some message
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer I get is:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{"jsonrpc": "2.0", "method": "OnAuthenticationInformation", "params": {"loginUri": "http: // my-qliksense-domain: 80 / internal_forms_authentication /? targetId = a5ee264a-8fa5-4303- 916d-a4ef7774d0b8 "," mustAuthenticate ": true}}&lt;/LI-CODE&gt;&lt;P&gt;I am not sure how I should follow the authentication process.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:12:27 GMT</pubDate>
    <dc:creator>oscar2511</dc:creator>
    <dc:date>2024-11-16T20:12:27Z</dc:date>
    <item>
      <title>Qlik Engine JSON API - authentication</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Engine-JSON-API-authentication/m-p/1616072#M45855</link>
      <description>&lt;P&gt;Hi, I need to get a list of the apps through an external development. I tried to do it with "Qlik Engine JSON API" using websockets in nodejs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const WebSocket = require ('ws');

// Set certPath to the path to the directory that contains the exported client certificates in PEM format.
var certPath = path.join ('C:', 'ProgramData', 'Qlik', 'Sense', 'Repository', 'Exported Certificates', '.Local Certificates');

var certificates = {
cert: fs.readFileSync (path.resolve (certPath, 'client.pem')),
key: fs.readFileSync (path.resolve (certPath, 'client_key.pem')),
root: fs.readFileSync (path.resolve (certPath, 'root.pem'))
};

// Open a WebSocket using the engine port (rather than going through the proxy)
// We use the certificates and a built-in Qlik service account
// We connect at the global level, which gives access to APIs in the Global class

const ws = new WebSocket ('wss: //server.domain.com: 4747 / app /', {
ca: certificates.root,
cert: certificates.cert,
key: certificates.key,
headers: {
'X-Qlik-User': 'UserDirectory = internal; UserId = sa_engine '
}

});

ws.onopen = function (event) {
// send some message
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The answer I get is:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{"jsonrpc": "2.0", "method": "OnAuthenticationInformation", "params": {"loginUri": "http: // my-qliksense-domain: 80 / internal_forms_authentication /? targetId = a5ee264a-8fa5-4303- 916d-a4ef7774d0b8 "," mustAuthenticate ": true}}&lt;/LI-CODE&gt;&lt;P&gt;I am not sure how I should follow the authentication process.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:12:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Engine-JSON-API-authentication/m-p/1616072#M45855</guid>
      <dc:creator>oscar2511</dc:creator>
      <dc:date>2024-11-16T20:12:27Z</dc:date>
    </item>
  </channel>
</rss>

