python - 尝试推送通知时的 Cloud Pub/Sub Demo : 403 User not authorized to perform this action.

标签 python google-app-engine google-cloud-platform google-cloud-pubsub

我正在学习 Google Cloud Pub/Sub 并遵循此官方文档:Writing and Responding to Pub/Sub Messages - Python

当我将它部署到云端并尝试提交消息时, enter image description here 我收到以下错误:

An internal error occurred: 403 User not authorized to perform this action. (POST https://pubsub.googleapis.com/v1/projects/your-project-id/topics/your-topic:publish) See logs for full stacktrace.

我猜这是由于某些身份验证问题?任何帮助将不胜感激。

最佳答案

确保您使用的客户端已获得发布到 Pub/Sub 的授权。参见 details here .如果您的客户端与主题属于同一项目,通常不需要额外的访问控制配置。确保您的客户是 authenticated properly .

关于python - 尝试推送通知时的 Cloud Pub/Sub Demo : 403 User not authorized to perform this action.,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37623509/

相关文章:

python - pyplot : Dotted line with FancyArrowPatch

python - Google cloud app.yaml cron.yaml for python 脚本不工作但没有日志

linux - Google Cloud SDK - 有没有办法在没有互联网访问的情况下在 Linux 上手动安装 google cloud sdk?

python - Scrapy——抓取页面并抓取下一页

javascript - flask-security ajax 注销导致 session 错误

python - 如何同步对存储数据的访问?

google-cloud-platform - Google Pub/Sub + Cloud Run 生成多个容器

mysql - 错误 2003 (HY000) : Can't connect to MySQL server on 'xxx.xxx.xx.xx' (10060)

python - 使用 ftplib 循环 ftp 中的文件在第二个循环中返回 "No such file or directory"

python - 延迟的 GAE 重定向