Gmail API Pub/Sub Push没有停止。

huangapple go评论89阅读模式
英文:

Gmail API Pub/Sub Push not stopping

问题

我正在使用Gmail API进行开发,一切都正常,我可以授权用户帐户将电子邮件推送到我的端点并发送下一个历史记录ID。
问题出在删除帐户上。我已经从Google Cloud Platform中删除了该帐户,我还从Gmail的帐户/设置/已连接的应用和站点中删除了该应用,但是仍然有一些东西在向我的Web服务器推送更新。我可以看到请求进来,但未被授权,但它仍然在继续推送。我该如何在Gmail中停止它?

我在服务器上收到以下信息:

2016/09/26 10:34:30 [D] [server.go:2202] | 503 |  41.984725ms|   match|  POST    /push   r:/push
d:  {user@name.com 2776948}
current user:  user@name.com
last history id:  2776700
doing error:  Get https://www.googleapis.com/gmail/v1/users/me/history?alt=json&startHistoryId=2776700: oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error" : "deleted_client",
  "error_description" : "The OAuth client was deleted."
}

所以客户端已被撤销,但推送仍在继续。非常奇怪...

英文:

I am developing with the Gmail API, and everything is working, I can authorize a user account to Push emails to my endpoint and send the next History ID.
The issue is with removing the account. I have deleted the account from the Google Cloud Platform, I have removed the app from Account/Settings/Connected Apps and Sites from within Gmail, however something is STILL pushing updates to my web server. I can see the request coming in and not being authorized, but it never the less is still pushing. How do I stop it in Gmail???

I receive this on my server:

2016/09/26 10:34:30 [D] [server.go:2202] | 503 |  41.984725ms|   match|  POST    /push   r:/push
d:  {user@name.com 2776948}
current user:  user@name.com
last history id:  2776700
doing error:  Get https://www.googleapis.com/gmail/v1/users/me/history?alt=json&startHistoryId=2776700: oauth2: cannot fetch token: 401 Unauthorized
Response: {
  "error" : "deleted_client",
  "error_description" : "The OAuth client was deleted."
}

So the client is revoked, but the push still occurs. Verry weird...

答案1

得分: 1

你还需要发送一个请求来停止监视用户的邮箱:

POST https://www.googleapis.com/gmail/v1/users/me/stop?access_token={access_token}
英文:

You also have to send a request to stop watching the user's mailbox:

POST https://www.googleapis.com/gmail/v1/users/me/stop?access_token={access_token}

huangapple
  • 本文由 发表于 2016年9月26日 18:37:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/39700619.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定