Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
pperdigo
Partner - Contributor II
Partner - Contributor II

401 Unauthorized, Code "AUTH-1" when calling /login/jwt-session

Hi everyone.
 
I'm getting a 401 - Unauthorized response with code "AUTH-1" when calling the /login/jwt-session endpoint from a local session proxy built with express modeled after the Implement a Qlik Cloud session cookie proxy example:
const resp = await fetch(`https://${tenantUri}/login/jwt-session`, {
            method: 'POST',
            headers: {
                Authorization: `Bearer ${token}`,
            },
        })
That error is unexpected because:
  1. The same setup was working earlier this week
  2. I don't get the "details" field on the response, all I get is: {"errors":[{"title":"Unauthorized","code":"AUTH-1","status":"401"}],"traceId":"bfd31bd2cb66b875ef9a975bb1ca91bc"}
  3. If I copy the exact same token and use it on Postman, the call is successful
I'm kinda stumped trying to fix this, since I can't find what "code":"AUTH-1" means anywhere and I also don't know what to do with that traceId. Anyone has any ideas to help with debugging?
Labels (2)
2 Replies
alex_colombo
Employee
Employee

Hey @pperdigo , compare request headers from your code and Postman, maybe you are missing something. If it works from Postman, should work from your code as well.

pperdigo
Partner - Contributor II
Partner - Contributor II
Author

Hi Alex! Thanks for the reply

If I remender correctly, the headers were matching. Another weird thing I noticed after making this post is that if I ran the code from another device, the error wouldn't happen.

And as it turns out, a few days later, the code started working again on my main workstation and hasn't returned, so I just chalked it up to some browser weirdness.