Reputation: 21
I'm following the Google Developer "Quickstart: Run a Gmail App in Python" https://developers.google.com/gmail/api/quickstart/quickstart-python
All is ok up to step 3 "Run the sample", where the instructions say to "Run the sample using python quickstart.py."
When I do this, the expected result is my browser would load and start the authorization. Instead, I get the Error 400 page on Google.
Error: redirect_uri_mismatch
The redirect URI in the request: http://localhost:8080/ did not match a registered redirect URI
Problem is, "localhost..." is not in redirect URIs, I've checked many other questions similar to this, usually the answers suggest confirming the URL's are EXACTLY the same. I've done that, https/http, additional backslashes, all is identical. Google still says I'm sending localhost:8080.
Upvotes: 2
Views: 2203
Reputation: 7631
The redirect URI specified in the dev console should match what the app is actually redirecting to. Simply use http://localhost:8080/
as your redirect uri in the dev console instead of suffixing it with oauthclient... (which is the default that the dev console provides you).
Upvotes: 4