Google云端硬盘API Quickstart.py错误400:redirect_uri_mismatch [英] Google Drive API Quickstart.py Error 400: redirect_uri_mismatch

查看:126
本文介绍了Google云端硬盘API Quickstart.py错误400:redirect_uri_mismatch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 https://developers.google.com/drive/api/v3/quickstart/python 访问Google云端硬盘Api,但Google不断抛出redirect_uri_mismatch错误.

I'm using the https://developers.google.com/drive/api/v3/quickstart/python to access the Google Drive Api but Google keeps throwing redirect_uri_mismatch errors.

我将错误中的localhost:number添加到Web应用程序的客户端ID中的授权重定向URI中,但是每当我运行quickstart.py时,本地主机号都会更改.

I add the localhost:number from the error to the Authorised redirect URIs in the client ID for the Web Application, but whenever I run the quickstart.py, the local host number changes.

我在StackOverflow上发现了很多与此相关的问题,我已经花费了数小时来修复我的问题,但是我没有找到一个似乎可以解决我问题的答案.

I see there are loads of questions regarding this matter on StackOverflow and I've already spent hours looking to fix mine but I haven't found an answer that seems to solve it for me.

有什么想法吗?

尝试了其他答案,

Google OAuth 2授权-错误:redirect_uri_mismatch

错误:redirect_uri_mismatch pydrive

当前

推荐答案

Tanaike 的评论和答案在这里起作用: Google API OAuth 2.0 redirect_uri_mismatch错误

Tanaike's comment and answer here worked: Google APIs OAuth 2.0 redirect_uri_mismatch error

因此在quickstart.py中,进行以下更改,

So in quickstart.py, make the following change,

creds = flow.run_local_server(port=0) 

creds = flow.run_local_server(port=8080) 

http://localhost:8080/在URI列表中.

这篇关于Google云端硬盘API Quickstart.py错误400:redirect_uri_mismatch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆