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?
This problem could be related to caches or to some mistakenly set configuration on our side. We use default ones provided by nimbusds jwt DefaultJWTProcessor.
rover is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.