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: 
andreadl_deepcube
Contributor II
Contributor II

Service worker execution blocked when using qlik-embed with qlik enterprise on Windows

Hello i'm trying to embed qlik apps in my react app.
The version of Qlik in use is Qlik Sense May 2024 Patch 5.
I want to use a virtual proxy with ticket authentication.

The js assets loads after being redirected to internal_windows_authentication/?target_id=...

The problem is that the browser blocks the execution of service worker with this error:
Uncaught (in promise) SecurityError: Failed to register a ServiceWorker for scope ('https://{sense_host}/qlik-embed/') with script ('https://{sense_host}/qlik-embed/static-assets-auth-service-worker.js'): The script resource is behind a redirect, which is disallowed.

I noticed that even if i specify data-login-uri to a specific virtual proxy in the script it seems that the proxy in use is Central Proxy (Default), the cookie session name and the access control response header applied belongs to the central and not to the one defined in data-login-uri  

    <script
            crossorigin="anonymous"
            type="application/javascript"
            data-host="{sense_host}"
            data-login-uri="https://{sens_host}/msvil"
            data-cross-site-cookies="true"
    ></script>

What i'm doing wrong ?
Labels (4)
1 Solution

Accepted Solutions
andrefpc
Partner - Creator II
Partner - Creator II

Hi! I'm trying to set up a mashup (I'm using JWT with QSEOW) and I'm having the same issue.

@andreadl_deepcube were you able to solve the issue?

Thanks in advance.

View solution in original post

13 Replies
alex_colombo
Employee
Employee

Hey @andreadl_deepcube I reproduced your issue and seems to be a bug on both docs and code.

I've tried to define the VP into data-host prop and VP is now used by qlik-embed. This could be the bug on docs, but I'm going to check this internally and raised a doc modification request.

Now, qlik-embed starts to load resources using your VP but it is blocking on requesting /resources/autogenerated/product-info.json, which is not an authenticated requests. Seems that cookie for your VP is not used here. This is the code bug.

 

Please try to set your VP in data-host prop, and if you are able to reproduce product-info.json error, open a support case. I'm going to raise this internally as well.

andreadl_deepcube
Contributor II
Contributor II
Author

Hi @alex_colombo,
thank you and sorry for this late response.

I was solving the cookie error that also caused the various redirects to get the ticket via internal_windows_authentication.

Now the correct cookie is set and the assets are loaded correctly with the VP defined in the data-host prop (i removed completely the data-login-uri prop).

However I still have the service worker registration error. I think the server does a redirect because when the static-assets-auth-service-worker.js file is requested the cookie is not sent (even with data-login-uri prop).
I assume this happens because the service worker registration is done inside an iframe.

Screenshot 2024-11-21 alle 11.46.39.png

 

 

alex_colombo
Employee
Employee

Seems that cookie is not sent in any case. Which authentication type you are using into you Virtual Prxy? Could you please share you Qlik Virtual proxy configuration?

andreadl_deepcube
Contributor II
Contributor II
Author

Hi alex,
we're using ticket authentication. 
I've attached a video of the configuration (the allowed host is anonymized)

alex_colombo
Employee
Employee

I've tried to reproduce the issue but looking at my browser developer tool I'm not seeing that call to service worker js file. Could you please share your Qlik embed config and html tab where you are pointing to a Qlik viz?

andreadl_deepcube
Contributor II
Contributor II
Author

Hi alex,
i've attached the html file and screenshots.
In order to see the iframe's requests on chrome's network tab you need to enable chrome://flags/#strict-origin-isolation 

alex_colombo
Employee
Employee

@andreadl_deepcube I can reproduce your issue, please open a support case

andrefpc
Partner - Creator II
Partner - Creator II

Hi! I'm trying to set up a mashup (I'm using JWT with QSEOW) and I'm having the same issue.

@andreadl_deepcube were you able to solve the issue?

Thanks in advance.

andreadl_deepcube
Contributor II
Contributor II
Author

Hi @andrefpc 

we have opened a ticket (not me directly because I am not the account owner). I await answers/solutions.
I will update this thread.