title: Issues with Google OAuth2 in iOS - "invalid_grant" error
body: <p>I'm having issues with Google OAuth2 in iOS; I'm getting an "invalid_grant" error. I am doing the following steps:</p>
  
  <ol>
  <li>I created the project and Credential ( iOS app ) Google Console;</li>
  <li>I did request the CODE;</li>
  <li>I did request the access token (working well);</li>
  <li>10 minutes before the expiry of the access token , I do request a refresh token.</li>
  </ol>
  
  <p>The problem is intermittent . Sometimes the request for refresh ( refresh_token ) returns " invalid_grant " and so the access_token becomes invalid and my application just stops .</p>
  
  <p>If forcing the user login to generate a new access_token and refresh_token not work. I have to revoke the permissions of the account and try again.
   
  What I need is access to IMAP and SMTP Gmail . If I check the access_token ( <a href="https://www.googleapis.com/oauth2/v1/tokeninfo" rel="nofollow">https://www.googleapis.com/oauth2/v1/tokeninfo</a> ) is active and valid , but the IMAP and SMTP denies access.</p>
  
  <p>I'm actually thinking of going back to the login username and password . The service is very unstable for not having the same reaction . I'm sure I'm not bursting any limitations and been the message " invalid_grant " would at least not appropriate.</p>
  
  <p>Please , any employee of Google, HELP ME !</p>
  
  <p>Thank you.</p>