gpt4 book ai didi

python-3.x - 错误 : redirect_uri_mismatch pydrive

转载 作者:行者123 更新时间:2023-12-04 00:04:24 25 4
gpt4 key购买 nike

我正在尝试连接到 google drive,为此我正在使用 python pydrive 库。我已经按照文档编写了一个片段来连接谷歌驱动器。但我收到一个错误
错误:redirect_uri_mismatch

请求中的重定向 URI,http://localhost:8080/ , 与为 OAuth 客户端授权的不匹配。更新授权的重定向 URI

这是我执行的pydrive代码(我也安装了pydrive库)

from pydrive.auth import GoogleAuth

gauth = GoogleAuth()
gauth.LocalWebserverAuth()

我正在发布我的 console.developer 帐户的图像,您可以看到我已按照 pydrive 文档的指定正确写入了地址。我还在 url 中添加了回调,但我仍然遇到相同的错误。任何帮助将不胜感激。谢谢
Console.developers account

Added outhcallback

这是我的 client_secrets.json 文件内容:

{"web":{,"project_id":"my-project-1532814702018","auth_uri":" https://accounts.google.com/o/oauth2/auth","token_uri":" https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url5":"|7915| redirect_uris":[" https://www.googleapis.com/oauth2/v1/certs "],"javascript_origins":[" http://localhost:8080/oauth2callback "," http://localhost "]}}

(我在这里删除了客户端 ID 和客户端密码)

最佳答案

我知道现在有点晚了,但它可能会帮助遇到此问题的人。
对我来说,这真的很愚蠢。在“Authorized redirect URIs”字段中,它必须是“http://localhost:8080/ ”,末尾有一个斜杠。在“Authorized JavaScript origins”中,它必须是“http://localhost:8080”,不带斜杠。

关于python-3.x - 错误 : redirect_uri_mismatch pydrive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51585346/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com