Validate expire time and signing key algorithm
I have the following code used to decode and verify JWT token:
Jwt authentication errors, changing kid
I’m using jwt oauth2 to authenticate access to my platform. Authentication is set up using spring and is working mostly correctly. The problem I’m facing is that authentication is not working consistently and end2end tests (which pass through authentication) sometimes fails.
After some digging around I found that the identity provider changes the kid every 300 ms, more or less, and there are two that alternates.
When the tokens are generated using the same kid used by the application then they work fine. When I use the tokens through postman they don’t work for some seconds and then they start working.
What could be the reason and how should I fix this?
Jwt authentication errors, changing kid
I’m using jwt oauth2 to authenticate access to my platform. Authentication is set up using spring and is working mostly correctly. The problem I’m facing is that authentication is not working consistently and end2end tests (which pass through authentication) sometimes fails.
After some digging around I found that the identity provider changes the kid every 300 ms, more or less, and there are two that alternates.
When the tokens are generated using the same kid used by the application then they work fine. When I use the tokens through postman they don’t work for some seconds and then they start working.
What could be the reason and how should I fix this?