OAuth2 Refresh Token Only Works For An Hour In Google Integration

Document created by sheng_liao462475 Employee on May 5, 2017Last modified by sheng_liao462475 Employee on Jan 25, 2018
Version 4Show Document
  • View in full screen mode

Issue

When using HTTP Client connector for use with Google API via OAuth2, the access token does not refresh after a period of time. The process only works for an hour and then fails with error "401 Invalid Credentials" or error "Unable to set HTTP OAuth2 Authorization on connection. Failed updating OAuth Token".

 

Solution

  1. Make sure to use the following Access Token URL and Authorization Token URL.
    1. Authorization Token URL: https://accounts.google.com/o/oauth2/v2/auth
    2. Access Token URL: https://www.googleapis.com/oauth2/v4/token
  2. Remove 'approval_prompt = force' from Authorization Parameter. approval_prompt was replaced by prompt in the V2 authorization endpoint so you shouldn't need this.
  3. Add 'prompt = consent' to Authorization Parameter.
  4. Regenerate token.
  5. Save and redeploy the process.

Please note that if you are using V1 endpoint, approval_prompt is required in order to get a refresh token. It is however not needed if you are using V2 endpoint.

 

4 people found this helpful

Attachments

    Outcomes