<?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: JWT 401 unauthorized in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451718#M20549</link>
    <description>&lt;P&gt;You have to use the IdP subject.&lt;BR /&gt;I have just tried with Postam (I guess you are using Postman) and it works. The only thing that I see here is that there is something in the certificate which you are using for generate the token, maybe a mismatch between it and the private key set in IdP configuration in MC.&lt;/P&gt;
&lt;P&gt;Could you please check &lt;A href="https://qlik.dev/authenticate/jwt/create-signed-tokens-for-jwt-authorization/#add-the-public-key-to-the-configuration" target="_blank"&gt;this &lt;/A&gt;step in JWT configuration and check if you have remove any carriage returns or line feeds existing in the text?&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2024 12:01:31 GMT</pubDate>
    <dc:creator>alex_colombo</dc:creator>
    <dc:date>2024-05-13T12:01:31Z</dc:date>
    <item>
      <title>JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450736#M20506</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;i'm trying to login to qlik using a JWT token but when i try to post to &lt;A href="https://horsadev.eu.qlikcloud.com/login/jwt-session" target="_blank" rel="noopener"&gt;https://horsadev.eu.qlikcloud.com/login/jwt-session&lt;/A&gt;&amp;nbsp;with the the web integration id and the bearer token i get the following error.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LorisLombardo87_0-1715252504937.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/165768iE0A1DA45F271CE04/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LorisLombardo87_0-1715252504937.png" alt="LorisLombardo87_0-1715252504937.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;the token is made up like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LorisLombardo87_2-1715252675807.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/165770i989E311865371085/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LorisLombardo87_2-1715252675807.png" alt="LorisLombardo87_2-1715252675807.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;user details: name sub and email are the exactly like the console.&lt;/P&gt;
&lt;P&gt;any idea of what can go wrong here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;Loris&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 11:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450736#M20506</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-09T11:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450739#M20507</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you check if the token isn't expired yet ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regard&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 11:17:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450739#M20507</guid>
      <dc:creator>mpc</dc:creator>
      <dc:date>2024-05-09T11:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450771#M20509</link>
      <description>&lt;P data-unlink="true"&gt;thanks for the suggestion Mpc&lt;/P&gt;
&lt;P data-unlink="true"&gt;the token is created with&lt;SPAN&gt;&amp;nbsp;&lt;A href="https://www.npmjs.com/package/jsonwebtoken" target="_blank" rel="noopener"&gt;jsonwebtoken&lt;/A&gt;&amp;nbsp;I've tried various configurations of expiresIn from 30s to 60m&amp;nbsp;and it is anyway consumed just after its creation, always the same result unfortunately.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;Loris&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 12:19:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450771#M20509</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-09T12:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450778#M20510</link>
      <description>&lt;P&gt;Ok, I assume you've followed this guide:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Member-Articles/Enhanced-Guide-Embedding-Qlik-Cloud-Content-with-JWT/ta-p/2110735" target="_blank"&gt;https://community.qlik.com/t5/Member-Articles/Enhanced-Guide-Embedding-Qlik-Cloud-Content-with-JWT/ta-p/2110735&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 12:27:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450778#M20510</guid>
      <dc:creator>mpc</dc:creator>
      <dc:date>2024-05-09T12:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450790#M20511</link>
      <description>&lt;P&gt;no i haven't, there are so many qlik guides on this topic on line &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;...&lt;/P&gt;
&lt;P&gt;the interesting bits on that guide though is the mention of the sub field, I've used the one that I can get clicking on the i icon in the users list.&lt;/P&gt;
&lt;P&gt;is it the same as the one I can get with&amp;nbsp;&lt;A href="https://yourcloudtenant/api/v1/users/me" target="_blank"&gt;https://yourcloudtenant/api/v1/users/me&lt;/A&gt;&amp;nbsp;?&lt;/P&gt;
&lt;P&gt;in general what should this sub field (claim) be?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 12:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450790#M20511</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-09T12:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450795#M20512</link>
      <description>&lt;P&gt;You should use the one provided by the URL its return. It's not the one you cand find on the (i) icon in the QMC.&amp;nbsp;&lt;BR /&gt;Moreover, in the final script, you will use&amp;nbsp;&lt;A href="https://yourcloudtenant/api/v1/users/me" target="_blank" rel="nofollow noopener noreferrer"&gt;ttps://yourcloudtenant/api/v1/users/me&lt;/A&gt;&amp;nbsp;to affect the right sub to the user who attempt to log in.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 12:49:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450795#M20512</guid>
      <dc:creator>mpc</dc:creator>
      <dc:date>2024-05-09T12:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450811#M20515</link>
      <description>&lt;P&gt;just to be 100% clear shall I use the one highlighted in red here ?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LorisLombardo87_0-1715260210550.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/165786iCB38E7D537886D9E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LorisLombardo87_0-1715260210550.png" alt="LorisLombardo87_0-1715260210550.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 13:10:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450811#M20515</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-09T13:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450815#M20517</link>
      <description>&lt;P&gt;Yes, it's not the good one, you shoud use the Qlik one beggining by 6 in your screnshot&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 13:20:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450815#M20517</guid>
      <dc:creator>mpc</dc:creator>
      <dc:date>2024-05-09T13:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451064#M20519</link>
      <description>&lt;P&gt;I think the issue might be somewhere else, the error message doesn't change if I add one or the other.&lt;/P&gt;
&lt;P&gt;if i look at that guide i cannot see any other suspect element...&lt;/P&gt;
&lt;P&gt;any other suggestion ?&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 08:17:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451064#M20519</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-10T08:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451181#M20526</link>
      <description>&lt;P&gt;Hey &lt;SPAN class="mention" data-mention="@LorisLombardo87"&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/192618"&gt;@LorisLombardo87&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;, token seems to be correct. I'm sharing how I create it with jsonwebtoken.&lt;/P&gt;
&lt;P&gt;Can you post your JWT IdP configuration set in Management Console and you HTTP request?&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const private_key = fs.readFileSync("./key/privatekey.pem", "utf8");

const tenantHost = 'saas.qlikcloud.com';

const id = {
    email: `email@qlik.com`,
    name: "Alex Colombo",
    sub: `idp_subject`
};

const signingOptions = {
    keyid: "keyId",
    algorithm: "RS256",
    issuer: "saas.qlikcloud.com",
    expiresIn: "1m",
    notBefore: "0s",
    audience: "qlik.api/login/jwt-session",
};

const payload = {
    jti: crypto.randomBytes(16).toString("hex"),
    sub: id.sub,
    subType: "user",
    email_verified: true,
    email: id.email,
    name: id.name,
    groups: id.groups,
};

const token = jsonwebtoken.sign(payload, private_key, signingOptions);

console.log(token);

setTimeout(async () =&amp;gt; {
    const resp = await fetch(`https://${tenantHost}/login/jwt-session`, {
        method: "POST",
        headers: {
        Authorization: `Bearer ${token}`,
        },
    });
    const resp2 = await fetch(`https://${tenantHost}/api/v1/items?resourceType=app`, {
        headers: {
        Authorization: `Bearer ${token}`,
        },
    });

    console.log('resp status: ', resp2.status)
}, 200)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 14:12:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451181#M20526</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-05-10T14:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451215#M20529</link>
      <description>&lt;P&gt;Hi Alex, Sure!&lt;/P&gt;
&lt;P&gt;the http request is as follow:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt; async jwtLogin(token: string) {
    const authHeader = `Bearer ${token}`;
    return await fetch(`https://${environment.QlikTenant}/login/jwt-session?qlik-web-integration-id=${environment.webIntegrationID}`, {
      credentials: 'include',
      mode: 'cors',
      method: 'POST',
      headers: {
        'Authorization': authHeader,
        'qlik-web-integration-id': environment.webIntegrationID,
        'Content-Type': 'application/json'
      },
    })
  }&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the IdP configuration is very simple:&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LorisLombardo87_0-1715355198808.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/165859i7545DEC4242EB9B8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LorisLombardo87_0-1715355198808.png" alt="LorisLombardo87_0-1715355198808.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;issuer and keyid have been left blank at the moment of creation, the one you see have been automatically populated by the console, and are matching what's in the JWT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for the support,&lt;/P&gt;
&lt;P&gt;Loris&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 15:36:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451215#M20529</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-10T15:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451653#M20543</link>
      <description>&lt;P&gt;You don't need the webintegration id, mode:CORS and credential: include. Could you please remove them and try again. Also, try to compare my request with yours and di exactly the same, it should work.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:30:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451653#M20543</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-05-13T09:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451665#M20545</link>
      <description>&lt;P&gt;Thanks Alex, still the same. unfortunately.&lt;/P&gt;
&lt;P&gt;can you please also double check if what MPC what suggesting a few comments earlier about the sub&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2450811/highlight/true#M20515" target="_self"&gt;here&lt;/A&gt;&amp;nbsp; is correct ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 10:03:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451665#M20545</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-13T10:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451718#M20549</link>
      <description>&lt;P&gt;You have to use the IdP subject.&lt;BR /&gt;I have just tried with Postam (I guess you are using Postman) and it works. The only thing that I see here is that there is something in the certificate which you are using for generate the token, maybe a mismatch between it and the private key set in IdP configuration in MC.&lt;/P&gt;
&lt;P&gt;Could you please check &lt;A href="https://qlik.dev/authenticate/jwt/create-signed-tokens-for-jwt-authorization/#add-the-public-key-to-the-configuration" target="_blank"&gt;this &lt;/A&gt;step in JWT configuration and check if you have remove any carriage returns or line feeds existing in the text?&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 12:01:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2451718#M20549</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-05-13T12:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2454807#M20622</link>
      <description>&lt;P&gt;Hi Alex, we have decided to switch to SAML.&lt;/P&gt;
&lt;P&gt;unfortunately all the suggestions have been ineffective.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 15:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2454807#M20622</guid>
      <dc:creator>LorisLombardo87</dc:creator>
      <dc:date>2024-05-21T15:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: JWT 401 unauthorized</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2455099#M20629</link>
      <description>&lt;P&gt;I strongly reccomend to open a support case about this.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 09:47:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JWT-401-unauthorized/m-p/2455099#M20629</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-05-22T09:47:03Z</dc:date>
    </item>
  </channel>
</rss>

