How to refresh an access token every once in a while?

Google: Why does the OAuth API use refresh tokens?

  • I've been hacking around with the Google OAuth API and it looks as if they're the only site I've worked with that gives you a refresh token. The access token expires after an hour but it's very easy to get a new one using the refresh token. I'm just wondering why they don't just make the access token have a longer time to expiration?

  • Answer:

    Because in that way if one access_token is compromised it's only compromised until the next refresh :) I've now found out that refresh_token's are only issued to those requesting offline scope/permissions.

Christoffer Aasted at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.