I am not quite sure why refresh token is necessary while we can store simply a refresh-time which maps to the same thing as refresh token's expire date, and not have a refresh token at all.
I understand that having a long-lived access token is not good for many security reasons, hence refresh tokens are used.
But I can achieve the exact same behavior of a refresh token by having a short-lived access token with the following scenario: The authenticator can have its own database where it stores the access token itself, and a refresh time as a plain integer. And if the access token is expired, this refresh time is checked and access token is either reissued or not based on whether this refresh time is expired as well. You might say latency-wise this requires lots of unnecessary database calls, but this all can be cached on the server-side really easily, thus can be avoided.
So my question is simply: Why refresh tokens are necessary (and sending it back and forth to the client) while all the refreshing of a short-lived token (access token) can be handled with a simple refresh time integer?
Access tokens are non revokable in many distributed systems. To mitigate a risk of stealing of an access tokens, these tokens are short lived.
Clearly, short lived access tokens are a great inconvenience for customers. Hence, there is a refresh token idea - use the refresh token to get a renewed access token when the access token expires.
The main difference between access and refresh tokens is that the refresh token is revokable.
If a user is compromised, these steps will happen: