我正在使用https://developers.google.com/drive/api/v3/quickstart/python访问 Google Drive Api,但 Google 不断抛出 redirect_uri_mismatch
错误。
我将错误中的 localhost:number 添加到 Web 应用程序的客户端 ID 中的授权重定向 URI,但每当我运行 quickstart.py
时,本地主机号都会发生变化。
我看到 StackOverflow 上有很多关于此事的问题,我已经花了几个小时寻找解决我的问题,但我还没有找到似乎可以解决我的问题的答案。
有什么想法吗?
尝试过其他人的答案
目前
最佳答案
Tanaike的评论和答案在这里有效:Google APIs OAuth 2.0 redirect_uri_mismatch error
因此,在 quickstart.py
中进行以下更改,
creds = flow.run_local_server(port=0)
到,
creds = flow.run_local_server(port=8080)
当 http://localhost:8080/
位于 URI 列表中时。
关于python - Google Drive API Quickstart.py 错误 400 : redirect_uri_mismatch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63956706/