Situation
Currently we handle Opaque Token Caching as part of the token introspection. This is not optimal since the token is known beforehand when the IDP returns the token after successful authentication.
This can also lead to concurrency problems since multiple authenticated requests may attempt to cache the token simultaneously.
Wanted
The token should be cached only once after the successful authentication.
Solution
- Move the opaque token caching into the
LoginOAuth2SuccessHandler class