Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pgsimon3
Contributor II
Contributor II

REST Connector Authentication Cookie not accepted

Dear Qlik-Community,

I'm trying to connect to SAP Business One by Service Layer, which provides an REST API.

A Login is required first and provides a cookie, that needs to be sent within the header of every following GET request.

The login works fine with an REST Connector POST query and retrieves the required cookie.

Testing my expressions in POSTMAN, everything works fine and the cookie is automatically handled by POSTMAN.

Trying to insert the cookie as a query header for a GET request to retrieve data results in an error:

     Connection failed: HTTP protocol error 401 (Unauthorized):

     Requested resource requires authentication

If I'm trying to use any of the provided authentication methods of the REST Connector, the same error arrives, probably because a POST request is needed for the login.

I also tried the method described in another forum post: REST CONNECTOR locate the Authorization token

Where the a variable is set as the cookie value and then included via WITH CONNECTION, but this results in the same error

Can anyone share any insights how Qlik and/or SAP B1 handle the headers and cookies?

Best regards and thanks in advance

Simon

1 Solution

Accepted Solutions
pgsimon3
Contributor II
Contributor II
Author

To keep this thread updated:

The problem was an error in the SAP documentation. The authorization cookie has to be sent including the HASH values, which is not documented in SAP.

Best regard

Simon

View solution in original post

3 Replies
Levi_Turner
Employee
Employee

It'll very much depend on the REST endpoint, but this doc may be helpful: Handling Refresh Tokens with the Qlik REST Connector

pgsimon3
Contributor II
Contributor II
Author

Thanks for the suggestion.
Unfortunately that results in the same "Unauthorized" error. It seems to me that Qlik handles the httpheader somehow different done postman and SAP B1 therefore does not accept the authorization cookie.

Any ideas how Qlik handles the header?

pgsimon3
Contributor II
Contributor II
Author

To keep this thread updated:

The problem was an error in the SAP documentation. The authorization cookie has to be sent including the HASH values, which is not documented in SAP.

Best regard

Simon