Google API Python客户端错误

Max*_*x L 3 python api oauth-2.0 google-api-python-client

我想要一个用于获取Google+主页的脚本.我使用谷歌的 脚本.client-secrets.json文件是:

{
 "web": {
   "client_id": "##########",
   "client_secret": "############",
   "redirect_uris": ["http://localhost:8080/oauth2callback/"],
   "auth_uri": "https://accounts.google.com/o/oauth2/auth",
   "token_uri": "https://accounts.google.com/o/oauth2/token",
   "client_email":"##########@developer.gserviceaccount.com",
   "javascript_origins":["http://localhost:8080/"]
        }
}
Run Code Online (Sandbox Code Playgroud)

但是,当我想启动这个应用程序时,它会打开一个错误和破坏机器人的页面:

The redirect URI in the request: http://localhost:8080/ did not match a registered redirect URI

请帮我解决我的问题.

Max*_*x L 10

我找到了解决方案!您应该创建另一个客户端ID,但对于桌面应用程序!之后,您需要使用它的client_idclient_secret.它适用于无需托管的开发.

  • 你做我的晚上.我花了2个小时才发现这个答案,谷歌需要聘请其他人为他们写文档. (3认同)