使用Gmail API的Google云平台项目:为桌面应用程序创建令牌
范围:我想通过python和raspbery pi/raspian或Windows 10上的Gmail访问我的Gmail。
之后官方指南 Google我创建了一个项目,并启用了Gmail API,根据本指南对于桌面应用程序,下载并将其重命名为recertentials.json
running quickStart.py我得到我获得的正如预期的:
>>> #获取Gmail API服务
...服务= gmail_authenticate()
请访问此URL以授权此应用程序:https://accounts.google.com/o/oauth22 /auth?Response_type=code&Client_id= [xxx.apps.googleusercontent.com& rediRect_uri = http%3A%3A%2F%2FlocalHost%3a34551; state = [xxx]& access_type = offline
我关注链接到 unsafe :
并获取localhost的链接:
http:// localhost:34551/?state state state state state state state state = [xxx]& code = [xxx]& scope = https://mail.google.com/
问题: 如何获得应用程序授权 /获取client_secret.json < / code>等?
Scope: I want to access my Gmail via python and the Gmail API on Raspbery pi /Raspian or Windows 10.
Following the official guide from Google I created a project and enabled the Gmail API, Authorization credentials for a desktop application according to this guide for Desktop app, downloaded it and renamed it to credentials.json
when running quickstart.py I get as expected:
>>> # get the Gmail API service
... service = gmail_authenticate()
Please visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=[XXX.apps.googleusercontent.com]&redirect_uri=http%3A%2F%2Flocalhost%3A34551%2F&scope=https%3A%2F%2Fmail.google.com%2F&state=[xxx]&access_type=offline
When opening the URL in the browser:
I follow the link to unsafe:
and get the link to localhost:
http://localhost:34551/?state=[XXX]&code=[XXX]&scope=https://mail.google.com/
Question:
How can I get the app authorized / get the client_secret.json
, etc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
安装XAMPP解决了问题。
在这种情况下,Windows II不起作用
Installing xampp solved the issue.
The windows IIS did not work in this case