<?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 CORS error when embedding a graph in localhost page (JWT V-proxy) in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/CORS-error-when-embedding-a-graph-in-localhost-page-JWT-V-proxy/m-p/2495173#M21593</link>
    <description>&lt;P&gt;Hi, &lt;BR /&gt;I am trying to embed some graphs from Qlik Sense authenticating through a virtual proxy with JWT which was working perfectly until now. This is my HTML code that embeds the graph:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;html&amp;gt;
    &amp;lt;script&amp;gt;
        var xhr = new XMLHttpRequest();
        var token = '&amp;lt;jwt token&amp;gt;'

        xhr.open('GET', 'https://bi.dglserv.com.br/jwt/single/?appid=39119e36-67e8-42bc-b94e-d2d2f7471a39&amp;amp;obj=HKjPDJ&amp;amp;theme=horizon&amp;amp;opt=ctxmenu,currsel');
        xhr.onreadystatechange = handler;
        xhr.responseType = 'blob';
        xhr.setRequestHeader('Authorization', 'Bearer ' + token);
        xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
        xhr.send();

        function handler() {
        if (this.readyState === this.DONE) {
            if (this.status === 200) {
            // this.response is a Blob, because we set responseType above
            var data_url = URL.createObjectURL(this.response);
            document.getElementById('test').src=data_url;
            } else {
            console.error('no pdf :(');
            }
        }
        }
    &amp;lt;/script&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;iframe id="test" src="" style="border:none;width:100%;height:100%;"&amp;gt;&amp;lt;/iframe&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;And these are the setting from my virtual proxy:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luis_dgl_0-1732819333519.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/174975i8924AD54CCAEDB57/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luis_dgl_0-1732819333519.png" alt="luis_dgl_0-1732819333519.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;However I am getting a 403 (&lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;untrusted http origin header scheme is not allowed&lt;/SPAN&gt;) error when loading the page:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luis_dgl_1-1732819361266.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/174976i7BEB9B19294AC27B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luis_dgl_1-1732819361266.png" alt="luis_dgl_1-1732819361266.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="message-subject"&gt;&lt;BR /&gt;&lt;BR /&gt;Did anybody else have this problem? How did you fix it?&lt;/H2&gt;</description>
    <pubDate>Thu, 28 Nov 2024 18:45:07 GMT</pubDate>
    <dc:creator>luis_dgl</dc:creator>
    <dc:date>2024-11-28T18:45:07Z</dc:date>
    <item>
      <title>CORS error when embedding a graph in localhost page (JWT V-proxy)</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/CORS-error-when-embedding-a-graph-in-localhost-page-JWT-V-proxy/m-p/2495173#M21593</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;I am trying to embed some graphs from Qlik Sense authenticating through a virtual proxy with JWT which was working perfectly until now. This is my HTML code that embeds the graph:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;html&amp;gt;
    &amp;lt;script&amp;gt;
        var xhr = new XMLHttpRequest();
        var token = '&amp;lt;jwt token&amp;gt;'

        xhr.open('GET', 'https://bi.dglserv.com.br/jwt/single/?appid=39119e36-67e8-42bc-b94e-d2d2f7471a39&amp;amp;obj=HKjPDJ&amp;amp;theme=horizon&amp;amp;opt=ctxmenu,currsel');
        xhr.onreadystatechange = handler;
        xhr.responseType = 'blob';
        xhr.setRequestHeader('Authorization', 'Bearer ' + token);
        xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
        xhr.send();

        function handler() {
        if (this.readyState === this.DONE) {
            if (this.status === 200) {
            // this.response is a Blob, because we set responseType above
            var data_url = URL.createObjectURL(this.response);
            document.getElementById('test').src=data_url;
            } else {
            console.error('no pdf :(');
            }
        }
        }
    &amp;lt;/script&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;iframe id="test" src="" style="border:none;width:100%;height:100%;"&amp;gt;&amp;lt;/iframe&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;And these are the setting from my virtual proxy:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luis_dgl_0-1732819333519.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/174975i8924AD54CCAEDB57/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luis_dgl_0-1732819333519.png" alt="luis_dgl_0-1732819333519.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;However I am getting a 403 (&lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;untrusted http origin header scheme is not allowed&lt;/SPAN&gt;) error when loading the page:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luis_dgl_1-1732819361266.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/174976i7BEB9B19294AC27B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luis_dgl_1-1732819361266.png" alt="luis_dgl_1-1732819361266.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H2 class="message-subject"&gt;&lt;BR /&gt;&lt;BR /&gt;Did anybody else have this problem? How did you fix it?&lt;/H2&gt;</description>
      <pubDate>Thu, 28 Nov 2024 18:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/CORS-error-when-embedding-a-graph-in-localhost-page-JWT-V-proxy/m-p/2495173#M21593</guid>
      <dc:creator>luis_dgl</dc:creator>
      <dc:date>2024-11-28T18:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: CORS error when embedding a graph in localhost page (JWT V-proxy)</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/CORS-error-when-embedding-a-graph-in-localhost-page-JWT-V-proxy/m-p/2495246#M21594</link>
      <description>&lt;P&gt;Are you running your local env on http? Please try to switch over https.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 09:12:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/CORS-error-when-embedding-a-graph-in-localhost-page-JWT-V-proxy/m-p/2495246#M21594</guid>
      <dc:creator>alex_colombo</dc:creator>
      <dc:date>2024-11-29T09:12:14Z</dc:date>
    </item>
  </channel>
</rss>

