Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When trying to run load script in Qlik Sense using REST connection to NPrinting (using NTLM authentication) you get the below error message:
The following error occurred:
HTTP protocol error 403 (Forbidden):
The server refused to fulfill the request.
Qlik Sense September 2020 Patch 2 and later versions
R&D released a permanent fix for this issue which is included in Qlik Sense September 2020 Patch 2,
However, in the load script, you must still replace
let vCookieRaw = Peek('Set-Cookie',0,'_response_header'); let vCookie = TextBetween('$(vCookieRaw)','Secure,','Path=/',2);
with
Let vCookieRaw = Peek('Set-Cookie',0,'cookie_items'); Let vCookie = TextBetween(vCookieRaw,'SameSite=None,',' Path=/',SubStringCount(vCookieRaw,'SameSite=None')-1);
Workaround Qlik Sense June 2020
If using Qlik Sense June 2020 and cannot perform an upgrade but a file can be replaced.
NOTE: Please backup existing folder before proceeding below
Download the file attached on this article (below: qvrestconnector-enterprise.zip), unzip it and
1. Replace existing QvRestConnector folder content on the driver with this files.
The QvRestConnector folder is located in:
C:\Program Files\Common Files\Qlik\Custom Data\QvRestConnector
2. Replace the following
let vCookieRaw = Peek('Set-Cookie',0,'_response_header'); let vCookie = TextBetween('$(vCookieRaw)','Secure,','Path=/',2);
with*
//Extracts session cookie from the API response Let vCookieRaw = Peek('Set-Cookie',0,'cookie_items'); Let vCookie = TextBetween(vCookieRaw,'SameSite=None,',' Path=/',SubStringCount(vCookieRaw,'SameSite=None')-1);
*For some cases:
A request to NP returns one or more Set-Cookie headers that are parsed in the connector code. The value of the header is a list of semicolon separated key-value pairs. In case of multiple values with the same key, the last one should be used.
The sample load script extracts the key-value pair with NPWEBCONSOLE_SESSION as key. Then you could use the Sense string functions to achieve this result in a way that would work also in case of future changes to the cookies:
let session = TextBetween(vCookieRaw, 'NPWEBCONSOLE_SESSION', '; ', SubStringCount(vCookieRaw, 'NPWEBCONSOLE_SESSION'));
let vCookie = 'NPWEBCONSOLE_SESSION'&session&';';
Example of the key value pair (ending with semicolon) to extract:
NPWEBCONSOLE_SESSION=5d7ff2747
Do we need to stop engine service for replacing the connector. We recently upgraded Sense from Apr 2019 to June 2020 and facing this issue. The connector available here, didn't work for me, it failed data reload tasks for monitoring apps as well.
Pl let me now if I am missing something.
Thanks for your help.
Digvijay
Please take a look to https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Nprinting-REST-API-broke-after-June-2020-up... also.
Maybe you need to add the extra header too.