<?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 Re: Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503605#M21777</link>
    <description>&lt;P&gt;Thanks Alex, with the new update it's now working!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2025 17:36:17 GMT</pubDate>
    <dc:creator>jw25</dc:creator>
    <dc:date>2025-01-29T17:36:17Z</dc:date>
    <item>
      <title>Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2501149#M21724</link>
      <description>&lt;P&gt;I've been testing using the new&amp;nbsp;&lt;A href="https://github.com/qlik-oss/qlik-api-ts" target="_blank" rel="noopener"&gt;https://github.com/qlik-oss/qlik-api-ts&lt;/A&gt;&amp;nbsp;with an existing QAP server, (we're currently using enigma.js &lt;A href="https://github.com/qlik-oss/enigma.js/" target="_blank" rel="noopener"&gt;https://github.com/qlik-oss/enigma.js/&lt;/A&gt;, but I've noticed that hasn't had any official releases for over a year now..)&lt;/P&gt;
&lt;P&gt;I have some pre-existing JWT authentication model that works (with enigma.js), that sets a qlik-jwt-token into the headers of the site, however when testing something basic like opening a specific app, the&amp;nbsp;&lt;SPAN&gt;qix.&lt;/SPAN&gt;&lt;SPAN&gt;openAppSession seems to work, but the&amp;nbsp;appSession.getDoc() doesn't...&lt;BR /&gt;&lt;BR /&gt;Code I'm trying to use: (Token authentication occuring in background already)&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;appSession&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;await&lt;/SPAN&gt;&lt;SPAN&gt; qix.&lt;/SPAN&gt;&lt;SPAN&gt;openAppSession&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;SPAN&gt;config,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;appId&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;'08849f09-cc25-4635-b376-5caeb255c121'&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;app&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;await&lt;/SPAN&gt;&lt;SPAN&gt; appSession.&lt;/SPAN&gt;&lt;SPAN&gt;getDoc&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; console.&lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"App opened successfully"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; app;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; } &lt;/SPAN&gt;&lt;SPAN&gt;catch&lt;/SPAN&gt;&lt;SPAN&gt; (error) {&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; console.&lt;/SPAN&gt;&lt;SPAN&gt;error&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Failed to open app session:"&lt;/SPAN&gt;&lt;SPAN&gt;, error);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;Network console and network tab&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jw25_1-1738074311565.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176962iA92A065C1E73553D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jw25_1-1738074311565.png" alt="jw25_1-1738074311565.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jw25_2-1738074341237.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176963i30DA48032BC7F6A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jw25_2-1738074341237.png" alt="jw25_2-1738074341237.png" /&gt;&lt;/span&gt;
&lt;P data-unlink="true"&gt;&lt;BR /&gt;It seems to be trying to source a bundle&amp;nbsp;&lt;SPAN&gt;https://some-domain.com/jwt/qlik-embed/main.js&amp;nbsp;&amp;nbsp;and that call fails.&lt;/SPAN&gt;&lt;/P&gt;
I know theres a library called qlik-embed, but I'm not sure why it's trying to source it from my QAP server...&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Does anyone have any ideas? Or is&amp;nbsp;&lt;A href="https://github.com/qlik-oss/qlik-api-ts" target="_blank" rel="noopener"&gt;https://github.com/qlik-oss/qlik-api-ts&lt;/A&gt;&amp;nbsp;just not meant for QAP servers?&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Jan 2025 14:26:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2501149#M21724</guid>
      <dc:creator>jw25</dc:creator>
      <dc:date>2025-01-28T14:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2502422#M21743</link>
      <description>&lt;P&gt;Hey &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/316973"&gt;@jw25&lt;/a&gt;&lt;/SPAN&gt; could you please share your qlik/api &lt;I&gt;setDefaultHostConfig &lt;/I&gt;configuration? I'd like to check if you are pointing to your jwt virtual proxy and if you are setting crossSiteCookie property.&lt;/P&gt;
&lt;P&gt;Furthermore, the JWT auth needs to be done in the front end, fetching a Qlik resource attaching jwt token in request headers. When this is done, and cookie is set in the browser, you can proceed with qlik/api stuff.&lt;/P&gt;
&lt;P&gt;The error in your screenshots is telling you that qlik/api is trying to get Qlik resources from your JWT VP but JWT token is not attached to request headers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below an example of fetching Qlik resource using JWT VP&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
 &lt;P&gt;await fetch(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"https://_qlikServer_/jwt/qrs/about?xrfkey=0000000000000000",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;method: "GET",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mode: "cors",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;credentials: "include",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;headers: {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"Content-Type": "application/json",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"X-Qlik-xrfkey": "0000000000000000",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Authorization: `Bearer ${token}`,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp;)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;and below qlik/api configuration for re using Qlik cookie set by previous step&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
 &lt;P&gt;auth.setDefaultHostConfig({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;host: "https://_qlikServer_/jwt",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;crossSiteCookies: true,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;});&lt;/P&gt;
 &lt;P&gt;&amp;nbsp; &amp;nbsp;const appId = "_qlikAppId_";&lt;BR /&gt;&amp;nbsp; &amp;nbsp;const session = await qix.openAppSession({ appId });&lt;BR /&gt;&amp;nbsp; &amp;nbsp;const app = await session.getDoc();&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 22 Jan 2025 13:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2502422#M21743</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2025-01-22T13:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503081#M21763</link>
      <description>&lt;P&gt;Hi Alex&lt;/P&gt;
&lt;P&gt;Sorry for the delay.&lt;BR /&gt;&lt;BR /&gt;Here's the code I use to make sure the qlik jwt cookies is generated (it was abstraced away in this&amp;nbsp;qlikCmZephrService, so I've tried to pull out as much of the code as possible).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This time as well I've added the&amp;nbsp;&lt;SPAN&gt;setDefaultHostConfig function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;this.qlikCmZephrService.generateXrfKey();
this.qlikCmZephrService.qlikHost = 'some-domain.com/jwt';
const token = 'sometoken';
const xrfKey = this.qlikCmZephrService.xrfKey
const fullPath = `https://${this.qlikCmZephrService.qlikHost}/qrs/about?xrfkey=${xrfKey}`;
// eslint-disable-next-line
const options: any = {
  method: 'GET',
  mode: 'cors',
  cache: 'no-store',
  credentials: 'include',
  headers: {
    'Content-Type': 'application/json',
    'X-Qlik-xrfkey': xrfKey,
    'Authorization': `Bearer ${token}`
  }
};
const response = await fetch(fullPath, options);
console.debug('response', response)
auth.setDefaultHostConfig({
  host: 'https://some-domain.com/jwt',
  crossSiteCookies: true,
});

try {
      const appSession = qix.openAppSession({
        appId: '08849f09-cc25-4635-b376-5caeb255c121',
        hostConfig: { host: 'some-domain.com/jwt' },
      });
      // this.appSession = await openAppSession({ appId: '08849f09-cc25-4635-b376-5caeb255c121', hostConfig: { host: this.qlikCmZephrService.qlikHost}  });
      console.log('***appSession', appSession);
      const app = await appSession.getDoc();
      console.log('***app', app);
      this.tableObject = await app.getObject(DataTable)
      console.log('***this.tableObject', this.tableObject)
    } catch (error) {
      console.warn('ERROR', error);
    }
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I haven't put in the real jwt token used, but it is a RSA256 encoded one and I can see the response is working, because when I&amp;nbsp;call https://some-domain.com/jwt/qrs/about?xrfkey=someexrfkey&amp;nbsp;&amp;nbsp;with the bearer token in order to generate the qlik jwt cookie, the response works and I can see it setting the X-Qlik-Session-jwt cookie in the network tab:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jw25_0-1738074544038.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176964i2AC91A3F558C8E3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jw25_0-1738074544038.png" alt="jw25_0-1738074544038.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditor_3d9ca88b07ae4bjw25_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&lt;BR /&gt;
&lt;DIV class="lia-progress-placeholder mceNonEditable"&gt;
&lt;DIV class="lia-media-progress"&gt;&lt;I class="lia-fa lia-media-upload-progress lia-fa-picture-o"&gt;&lt;/I&gt;
&lt;DIV class="lia-progress-bar-stripes lia-progress-bar-animate lia-media-progress-bar"&gt;
&lt;DIV class="lia-progress-bar" style="width: 100%;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;SPAN class="lia-progress-value"&gt;Updating Media&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So even though that response to authenticate and authorise is successful, now in the console it isn't a 400 error anymore, it's a 404 (not found) error for that url again:&lt;/P&gt;
&lt;P data-unlink="true"&gt;https://some-domain.com/jwt/qlik-embed/main.js&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jw25_2-1738074640069.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176966i74F7A778879999CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jw25_2-1738074640069.png" alt="jw25_2-1738074640069.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;And just for some further context, we're using this type of server: i.e. the sort where you have to put /qmc on the domain to access the admin terminal, with a custom Virtual&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jw25_4-1738074710866.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176968i631175C0A3D7FB29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jw25_4-1738074710866.png" alt="jw25_4-1738074710866.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Any idea's on why the 404? or is what I'm doing not necessarily compatible with the type of qlik server/authentication model we're using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Jo&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 14:32:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503081#M21763</guid>
      <dc:creator>jw25</dc:creator>
      <dc:date>2025-01-28T14:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503202#M21765</link>
      <description>&lt;P&gt;Which Qlik Sense on prem version are you using?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 08:12:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503202#M21765</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2025-01-28T08:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503296#M21769</link>
      <description>&lt;P&gt;Qlik Sense February 2024 Patch 15 - 14.173.23&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jw25_5-1738074791187.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176969iE669CF46B878C3C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jw25_5-1738074791187.png" alt="jw25_5-1738074791187.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 14:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503296#M21769</guid>
      <dc:creator>jw25</dc:creator>
      <dc:date>2025-01-28T14:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503315#M21770</link>
      <description>&lt;P&gt;It should be a bug in that release, It should be fixed starting May 2024.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 14:04:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503315#M21770</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2025-01-28T14:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Testing qlik-oss/qlik-api-ts with a QAP server, but unable to getDoc</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503605#M21777</link>
      <description>&lt;P&gt;Thanks Alex, with the new update it's now working!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2025 17:36:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Testing-qlik-oss-qlik-api-ts-with-a-QAP-server-but-unable-to/m-p/2503605#M21777</guid>
      <dc:creator>jw25</dc:creator>
      <dc:date>2025-01-29T17:36:17Z</dc:date>
    </item>
  </channel>
</rss>

