title: OAuth Refresh Token Best Practice
body: <p>I am implementing OAuth for a project, and I want to know the best way to handle refresh tokens.</p>
  <p>The API I call will return a JSON object with access_token, expires_in, and refresh_token.
  So I was wondering, is it better to:</p>
  <ol>
  <li><p>Calculate the time when the access_token will expire, store that in the database. Check that the access_token is not expired every time I make an API call, and if it is expired then use the refresh_token to get a new access_token.</p>
  <p>(Additional Question: how do I make sure that the time which I calculate for the token expiration is accurate? Because the expire_in value probably starts from when the API server generated the key, and not when I receive it.)</p>
  </li>
  </ol>
  <p>OR</p>
  <ol start="2">
  <li>Just try to make the API call with the access_token every time, and if that returns with an error then use the refresh_token.</li>
  </ol>
  <p>I am also open to other options of implementing this.</p>