【问题标题】:How to enable scopes at gmail console如何在 gmail 控制台启用范围
【发布时间】:2016-02-19 11:02:24
【问题描述】:

我正在通过 pub/sub 将来自 gmail 的通知发送到网络服务器,

我已经阅读了他们提到启用范围的文档

https://cloud.google.com/pubsub/configure

我通过代码指定以下范围

https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/pubsub

即使在为特定用户调用 watch() 之后指定了这些范围之后,它还是给了我

Google::Apis::ClientError: forbidden: Error sending test message to Cloud PubSub projects/project-id/topics/topic-name : User not authorized to perform this action.

那么我需要从谷歌控制台启用这些范围吗?如果是,那么您能告诉我们这样做的方向吗?

【问题讨论】:

  • @GaganGami 感谢您的链接,但它没有提及与我正在寻找的范围相关的任何内容。

标签: ruby-on-rails gmail-api gmail-imap google-cloud-pubsub


【解决方案1】:

范围在这里不相关。 Gmail 系统始终使用此服务帐户“gmail-api-push@system.gserviceaccount.com”。您需要做的是授予此服务帐户发布有关您的主题的消息的权限。

另请参阅: https://developers.google.com/gmail/api/guides/push#grant_publish_rights_on_your_topic

【讨论】:

    猜你喜欢
    • 2015-11-22
    • 1970-01-01
    • 2015-09-02
    • 1970-01-01
    • 1970-01-01
    • 2019-10-07
    • 2020-06-17
    • 2015-05-18
    • 2018-06-14
    相关资源
    最近更新 更多