Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
akhramovich
Contributor
Contributor

JWT is not working (401, Unauthorized)

Hello, 

We are using JWT token for authorization but getting 401 Unauthorized error

Here are details of JWT we are trying to use

Screenshot 2023-04-11 at 20.53.46.png

Is there any way to undestand what exactly is wrong with JWT? 

 

Thank you,

Anton

Labels (1)
1 Solution

Accepted Solutions
jprdonnelly
Employee
Employee

@akhramovich - the 'nbf' date/time indicates that the JWT cannot be used for authorization before that timestamp. Your 'nbf' should be the moment you want that token to be valid for authentication, and the 'exp' cannot be greater than 60m later.

This means that a token can only be used to initiate a session within that 60m window, it does not dictate the length of a valid session once it has been established.

- @jprdonnelly

View solution in original post

2 Replies
jprdonnelly
Employee
Employee

@akhramovich - the 'nbf' date/time indicates that the JWT cannot be used for authorization before that timestamp. Your 'nbf' should be the moment you want that token to be valid for authentication, and the 'exp' cannot be greater than 60m later.

This means that a token can only be used to initiate a session within that 60m window, it does not dictate the length of a valid session once it has been established.

- @jprdonnelly
akhramovich
Contributor
Contributor
Author

Thank You!