Spring oauth2 token caching

I use spring oauth2 to create media tokens and validate them. I store tokens in the database. I would like to know if there is any tool provided by spring oauth2 for caching a token, since it is expensive to cost on db and extract the token to check when the servers have suffered from 100 tps.

+5
source share
1 answer

I understand that it is old, but for others.

Try not to store tokens anywhere unless you need an object to cancel them. If you intend not to store them, this means that you (or should) use JTT-formatted tokens.

Spring, by default, includes user data in a bearer JWT access token that is created.

Therefore, your client / resource server, which is the recipient of the JWT token, has sufficient knowledge to automatically create an authentication object and control access to resources.

0
source

All Articles