Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sanekagr2
Partner - Contributor III
Partner - Contributor III

Issue loading image in "Text & Image" object with qlik-embed mashup

Hello,
I’m using qlik-embed in my mashup, with the authentication method set to OAuth2 for an SPA via a script in the <head>.

    <script
      crossorigin="anonymous"
      type="application/javascript"
      src="https://cdn.jsdelivr.net/npm/@qlik/embed-web-components@1/dist/index.min.js"
      data-host="https://<tenant>.eu.qlikcloud.com"
      data-client-id="0.....0"
      data-redirect-uri="http://localhost/<tenant>/"
      data-access-token-storage="session"
    ></script>

When I try to open an object of type "Text & Image", the object loads successfully, but the image within it returns a 401 error: (https://<tenant>.eu.qlikcloud.com/api/v1/apps/fa...79bf7/media/files/LEGEND_1.png

 <qlik-embed
          ui="classic/chart"
          app-id="{{app_id}}"
          object-id="fa...p"
          class="qlik-legend"
  ></qlik-embed>

If I open the app directly in the browser (Qlik interface), the image displays properly. All other objects load without issues in the mashup.

Is there a way to obtain permissions to access media files using this kind of authentication, or is there another recommended method for loading media content in this case?

Thanks!

Labels (3)
1 Solution

Accepted Solutions
DaveChannon
Employee
Employee

Could you try in iframe mode for that object? Like:

 <qlik-embed
          ui="classic/chart"
          app-id="{{app_id}}"
          object-id="fa...p"
          class="qlik-legend"
          iframe="true"
  ></qlik-embed>

 This should permit it access to assets outside of the immediate chart.

View solution in original post

4 Replies
DaveChannon
Employee
Employee

Could you try in iframe mode for that object? Like:

 <qlik-embed
          ui="classic/chart"
          app-id="{{app_id}}"
          object-id="fa...p"
          class="qlik-legend"
          iframe="true"
  ></qlik-embed>

 This should permit it access to assets outside of the immediate chart.

sanekagr2
Partner - Contributor III
Partner - Contributor III
Author

Hi,

Thanks for your reply.

I tried that, but it didn’t work. Also, for some reason, another element on the page, a layout container, suddenly disappeared after I added iframe="true" to the Text & Image element.

alex_colombo
Employee
Employee

using iframe prop should fix this issue. Could you please share your entire code base?

sanekagr2
Partner - Contributor III
Partner - Contributor III
Author

Yes, thanks. It fixed the problem, but the elements load slowly — which seems expected for an iframe. You need to use the CSS rule position: relative on the element that hosts the object with the iframe; otherwise, it can cause issues with the DOM