Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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.
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.
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.
using iframe prop should fix this issue. Could you please share your entire code base?
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