What if I have no refresh token? Or my refresh token has expired?

As we mentioned earlier, some service providers simply don't support the refresh token flow. Additionally, even if they do, refresh tokens also expire. Their lifetime is usually much longer, on the order of days or weeks—compared to minutes or hours with access tokens—but, nonetheless, they will expire eventually. So we must be prepared to handle the case where we want to get a new access token, but lack a valid refresh token to use to do so.

Our only alternative, in this case, would be to start the auth process again. To do this, we will essentially log the user back in as if we have never seen them before, starting the entire authorization request process, with whatever flow you ...

Get Mastering OAuth 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.