admin管理员组

文章数量:1417680

I have successfully used the Gmail API with Google Cloud Console and OAuth Playground to send emails. It worked for a few days, but after a while, my authentication gets revoked. Even though I make sure to re-enter my OAuth credentials, I still encounter the issue.

Goal: I am trying to create a contact page on my website that allows users to send emails to my inbox using the Gmail API.

Can anyone help me understand why my OAuth tokens are being revoked and how to make sure the email-sending functionality works consistently?

I have successfully used the Gmail API with Google Cloud Console and OAuth Playground to send emails. It worked for a few days, but after a while, my authentication gets revoked. Even though I make sure to re-enter my OAuth credentials, I still encounter the issue.

Goal: I am trying to create a contact page on my website that allows users to send emails to my inbox using the Gmail API.

Can anyone help me understand why my OAuth tokens are being revoked and how to make sure the email-sending functionality works consistently?

Share Improve this question asked Jan 31 at 10:09 OXYCNR1OXYCNR1 1 3
  • Oauth playground is just for testing. Its tokens are not going to last more then 3 days. You should implement oauth2 in your application if you want it to last longer. – Linda Lawton - DaImTo Commented Feb 1 at 16:39
  • Do you have any documentation regarding that? I have tried to implement it but i get an error about username and password not accepted. I double check on my credentials and refresh token and it seems fine – OXYCNR1 Commented Feb 9 at 11:44
  • Without seeing your code its hard to help more – Linda Lawton - DaImTo Commented Feb 9 at 17:30
Add a comment  | 

1 Answer 1

Reset to default -1

Based on the description you have provided, my best answer is that if your Outh Client ID and API key are still available in Cloud Dashboard(which you can check here: https://console.cloud.google/apis/api/gmail.googleapis/credentials?authuser=2&inv=1&invt=AboUDA&project=inboxiq-432403), I assume you may have gone over the allotted API credits.

It is also standard for OAuth Playground to delete access tokens after 3589 seconds, so that could be it.

Apologies I couldn't be more helpful.

本文标签: Google Oauth Refresh TokenStack Overflow