1

I am using Python to directly run a script of automatically replying user's comments.

I have a client secrets file after applying for a web-application. However, when I run for credentials, it first asks me to Please visit this URL to authorize this application and then when I clicked on it, it gives me this error:

Error 400: redirect_uri_mismatch The redirect URI in the request, urn:ietf:wg:oauth:2.0:oob, can only be used by a Client ID for native application. It is not allowed for the WEB client type. You can create a Client ID for native application at.

What application should I have applied for the OAuth in this case.

I know that this issue could be related to redirect URL. But because I am running this out of my script on my local computer, I am wondering what my URL should be.

stvar
  • 6,551
  • 2
  • 13
  • 28
llu13701
  • 133
  • 1
  • 12

1 Answers1

0

You have to acknowledge that your issue above is precisely due to the redirect URI mismatch. The error response you got from the API is indicating you this.

To fix you issue, you'll have to have the same redirect URI set on your project within Google developers console and, at the same time, within your Python script.

If you indeed are running your application on your desktop (laptop) computer, then follow on the error message advice: within Google developers console, do set your project type to be of Desktop kind.

stvar
  • 6,551
  • 2
  • 13
  • 28