question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gmail connection is limited by expiration of oauth token

See original GitHub issue

Creating a gmail connection requires adding an OAuth Client ID to the gmail API and registering syndesis accordingly (documented in the user guide). Publishing an integration involving gmail works as expected. However, subsequent republishings of the same integration or using the connection for other integrations frequently results in the published integration failing due to ‘401 unauthorized errors’.

The workaround is to remove the OAuth Client ID in the gmail API, recreate it and re-register the integration. The gmail documentation actually states:

This access token is passed to the Gmail API to grant your application access to user data for a limited time.

Is it possible that the token is quickly expiring and requires refreshing? If so, Is it possible to refresh the token automatically or lengthen the expiry time?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:43 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
TovaCohencommented, Sep 26, 2018

Thanks Zoran and Paul. We have time to get the 7.2 release notes text exactly right. I created this FUSEDOC issue to make sure it gets done: https://issues.jboss.org/browse/FUSEDOC-2869.

For 7.1, I’ll add the following today, and publish it on the customer portal unless I hear otherwise. @gaughan can you confirm that I should do this?

I will the following note here: [https://access.redhat.com/documentation/en-us/red_hat_fuse/7.1/html/release_notes/onlinedistrib#OnlineDistrib-Important] (Important Notes).

Published integrations that connect to Gmail stop executing when their Gmail API access token expires. To enable the integration to execute, re-register your Fuse Online environment as a Gmail API client and enter the new client ID and secret ID in the Fuse Online Settings page. (and that would be a link to the instructions for doing that) In the next release, it is expected that Fuse Online will obtain a new access token when needed and you will not need to re-register.

1reaction
phantomjinxcommented, Sep 26, 2018

@zregvart

I can confirm from my experience that deleting the oauth credentials in the google API console and creating new ones was sufficient. (As long as the new credentials were applied as I described above)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gmail auth token expires within an hour - Stack Overflow
The user has revoked your app's access. The refresh token has not been used for six months. The user changed passwords and the...
Read more >
Using OAuth 2.0 to Access Google APIs | Authorization
Access tokens have limited lifetimes. If your application needs access to a Google API beyond the lifetime of a single access token, ...
Read more >
Antipattern: Set a long expiration time for OAuth tokens
Set the expiration time for refresh tokens in such a way that it is valid for a little longer period than the access...
Read more >
Automatic OAuth 2.0 token revocation upon password change
Gmail IMAP sessions authenticated using OAuth aren't affected by a password change, but are limited to the validity period of the access token...
Read more >
HTTP OAuth2 Connection to Gmail and Google API fails after ...
The reason you are experiencing this error is because the access token returned by Gmail and Google API expire after 60 minutes. For...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found