Reputation: 1971
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.
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.
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.
Any ideas?
Tried answers from, amongst others,
Currently
Upvotes: 3
Views: 3383
Reputation: 43
Like LucSpan mentioned in the comments of the answer. the redirect URI needs to be "http://localhost:8080/" and not "http://localhost:8080" the missing "/" at the end matters
Upvotes: 0
Reputation: 1971
Tanaike's comment and answer here worked: Google APIs OAuth 2.0 redirect_uri_mismatch error
So in quickstart.py
, make the following change,
creds = flow.run_local_server(port=0)
to,
creds = flow.run_local_server(port=8080)
when http://localhost:8080/
is on the URIs list.
Upvotes: 4