'Redirect URI mismatch , why?
Following the directions here using latest/last python 2.7:
https://github.com/youtube/api-samples/tree/master/python
For the https://github.com/youtube/api-samples/blob/master/python/retrieve_reports.py script
Google oAuth explorer tests seem to work fine. URI authorized redirects are set in GCP to the following:
http://localhost/8080 http://localhost/
Running python retrieve_reports.py on my console with no changes to the above reporting script (other than inserting my credentials.json file)
I get the following on the Google oAuth page:
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 https://console.developers.google.com/apis/credentials/oauthclient
I've seen online I may need to use a public URI, but I'm not sure what that would be in my case...
Edit: I started using httP://127.0.0.1 as my redirect URI because of others saying online port numbers mess it up as well as URI that are not actual IP addresses.
Also, when I set up my credentials for a desktop app (not what Google's github documentation says, which recommends a webapp), I get a different error 400:
Error 400: invalid_request
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for keeping apps secure.
You can let the app developer know that this app doesn't comply with one or more Google validation rules. The content in this section has been provided by the app developer. This content has not been reviewed or verified by Google. If you’re the app developer, make sure that these request details comply with Google policies.
redirect_uri: urn:ietf:wg:oauth:2.0:oob
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|