Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Neil_Southern
Contributor II
Contributor II

JWT Proxy returns 400 error instead of 401 when navigating to hub

Hi All,  

Hope you can help, I have followed this article from @Damien_V @Sonja_Bauernfeind   very closely, 

 

Qlik Sense: How to set up JWT authentication - Qlik Community - 1716226

It mentions the instructions for testing.  There is no mention of linking a virtual proxy to proxy. Is this required?

  1. Try to go to the hub:

              https://{your server name}/{prefix for JWT virtual proxy}/hub/

  2. You should get a 401 error: "Could not authenticate the request: Expected an authentication header." as no header has been provided.

On trying to the simple test I get the following error:

400 Bad Request  The http request header is incorrect.
This is before I even try to submit a token..... Have I missed something fundamental?
We are on Qlik Sense May 2024 Patch 11 -14.187.17
I ultimately want to run the qlik.exe to execute unbuild command, so to extract the qvs scripts 
Thank you in advance
Neil
Labels (1)
2 Replies
Neil_Southern
Contributor II
Contributor II
Author

The issue was that we had not linked the proxy to the central node.  We added the host to the white list.

I have also managed to make a successful token which works with the https://{your server name}/{prefix for JWT virtual proxy}/hub/

ERROR MESSAGE

C:\Users\xxxxxx\Qlik_Extract>qlik qrs app ls
GET https://xxxxxxxxx/jwt/qrs/app?xrfKey=9F2Axxxx7AD1A03
* Establishing connection to: xxxxxxxxxxx:443
* TLS Handshake started
* TLS Handshake done (73ms), version: TLS v1.2
* Connection established (116ms)
> Host: xxxxxxxx
> User-Agent: qlik-cli/2.26.0 (windows)
> Authorization: **omitted**
> Content-Type: application/json
> Referer: https://xxxxxxxxxx/jwt/
> X-Qlik-Xrfkey: 9F2Axxxxx7AD1A03
> Accept-Encoding: gzip
< Cache-Control: no-cache
< Connection: keep-alive
< Content-Length: 96664
< Content-Type: text/html
Response time: 142ms


Status: 401 Could not authenticate the request: Expected an authentication header.
Reading Response 0s 79.72 KiB / 94.40 KiB [========================================================================================================================================> ] 84.45% 2.78 MiB/s 0s
Error: failed to read response body: unexpected EOF

This is a connection to On Prem system.

Header

{
"alg": "RS256",
"typ": "JWT",
"aud": "xxxxx"
}

 

Payload

{
"userID": "xxxxxx",
"userDirectory": "xxxxx",
"name":Neil Southern",
"email":"neil.southern@xxxxxxxxxxxx",
"roles":["RootAdmin"],
"host":["xxxxxxxxxx"]
}

I had read an article say host needed to be added - I have tried with and without and failed.

 

Context file 

current-context: qsxxx
contexts:
  qsxxxx:
    headers:
      Authorization: eyJhbGciOiJSxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    server-type: Windows
    verbose: true
 

Any Help greatly appreciated.

Thank you 

Neil 

 

 

 

Damien_V
Support
Support

Hi @Neil_Southern 
Did you configure the context in Qlik-cli as per below? The error suggests the JWT token is missing from the request.
https://qlik.dev/toolkits/qlik-cli/qlik-cli-qrs-get-started/

##qlik context create <contextName> --server <serverUrl> --server-type windows --api-key <JWTToken>



If the issue is solved please mark the answer with Accept as Solution.