Qlik Community

Knowledge

Search or browse our knowledge base to find answers to your questions ranging from account questions to troubleshooting error messages. The content is curated and updated by our global Support team

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS

Qlik Sense June 2020 connecting to NPrinting getting "HTTP protocol error 403 (Forbidden): The server refused to fulfill the request."

cancel
Showing results for 
Search instead for 
Did you mean: 
Sonja_Bauernfeind
Digital Support
Digital Support

Qlik Sense June 2020 connecting to NPrinting getting "HTTP protocol error 403 (Forbidden): The server refused to fulfill the request."

Attachments

When trying to run 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 fulfil the request.

 

Data Load Progress Failed.png

 

 

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. 

NOTEPlease 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=5d7ff2747d10d82e46c39f385ceb9fc48948adcf-%00userlogin%3A2021-03-22T14%3A56%3A21.9786004Z%00%00NPWEBCONSOLE_XSRF-TOKEN%3AwVMqYfj%2FrZrhR01OcKU2F8AtGIj9J9WfStbviXWhJRM%3D%00%00_TS%3Asession%00%00userid%3A74aaa5a6bdf547fa99a24cf4495b3bab%00;

 

Labels (1)
Comments
Digvijay_Singh

Hi@Sonja_Bauernfeind 

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

maksim_senin
Partner
Partner

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.

Version history
Last update:
‎2021-04-07 05:00 AM
Updated by: