添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
玩命的火腿肠  ·  Authentication ...·  1 周前    · 
眉毛粗的电梯  ·  在 Microsoft SQL ...·  1 周前    · 
坐怀不乱的鸡蛋  ·  A Quick Guide to ...·  2 周前    · 
粗眉毛的作业本  ·  Google OAUTH SSO 与 ...·  3 周前    · 
温柔的跑步鞋  ·  Token Exchange ...·  1 月前    · 
风流倜傥的松球  ·  条款和条件 | 3L联盟·  6 天前    · 
傲视众生的碗  ·  NuGet Restore task ...·  4 周前    · 
文武双全的足球  ·  Deprecated features ...·  6 月前    · 
Answered

HTTP OAuth2 Connection to Gmail and Google API fails after 60 mins due to token expiry

I am using the HTTP OAuth2 Connector to connect to Gmail and Google API to access some functionality that Workato doesn't support at the moment.


I am able to establish the connection and my recipes work fine. However, after 60 minutes from establishing a successful connection, my recipes start failing. I get this error message from my Gmail/Google API HTTP steps:

No automatic OAuth refresh available, needs user re-authorization

401 Unauthorized: { "error": { "errors": [ { "domain": "global", "reason": "authError", "message": "Invalid Credentials", "locationType": "header", "location": "Authorization" } ], "code": 401, "message": "Invalid Credentials" } }

What can I do to resolve this?

Hi Saul,

The reason you are experiencing this error is because the access token returned by Gmail and Google API expire after 60 minutes.

For this to work, you need to additional auth URL parameters in your connection setup. The addtional params will tell Google to return the access token WITH a refresh token. The refresh token will allow Workato to fetch a new access token whenever the previous one expires.

OAuth2 auth URL for Google API:

- Google API requires 1 additional param: Access type: offline (more info here )

https://accounts.google.com/o/oauth2/auth?scope=XXXX&response_type=code&redirect_uri=https%3A%2F%2Fwww.workato.com%2Foauth%2Fcallback & access_type=offline

OAuth2 auth URL for Gmail:

- Gmail's API requires 2 additional params, 1) Access type: offline, 2) Approval prompt: force (more info here )

https://accounts.google.com/o/oauth2/auth?response_type=code&scope=XXXX & access_type=offline & approval_prompt=force

Hi Saul,

The reason you are experiencing this error is because the access token returned by Gmail and Google API expire after 60 minutes.

For this to work, you need to additional auth URL parameters in your connection setup. The addtional params will tell Google to return the access token WITH a refresh token. The refresh token will allow Workato to fetch a new access token whenever the previous one expires.

OAuth2 auth URL for Google API:

- Google API requires 1 additional param: Access type: offline (more info here )

https://accounts.google.com/o/oauth2/auth?scope=XXXX&response_type=code&redirect_uri=https%3A%2F%2Fwww.workato.com%2Foauth%2Fcallback & access_type=offline

OAuth2 auth URL for Gmail:

- Gmail's API requires 2 additional params, 1) Access type: offline, 2) Approval prompt: force (more info here )

https://accounts.google.com/o/oauth2/auth?response_type=code&scope=XXXX & access_type=offline & approval_prompt=force


2 people like this