Google Tasks API Set Up Help for Python/Flask Application

141 views Asked by At

I'm new to using Google APIs in general. Could anyone help me figure out how to set up this tasks API correctly for my python/flask/sqlalchemy application?

I got the API key, client ID (and downloaded as credentials.json), pip installed the Quickstart for python, created the quickstart.py and credentials.json with provided code but when I ran that quickstart.py file, it says

"Error 400: redirect_uri_mismatch. The redirect URI in the request, http://localhost:51014/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/${your_client_id}?project=${your_project_number}"

When I tried each time, the port number kept changing.

On my terminal, it says

"lease visit this URL to authorize this application: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=624465110094-oa56kshqc0vml0k2uju45ro7tjg0jo8j.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A51014%2F&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ftasks.readonly&state=8MQQOCU8Do80dheS9iuRZJnG2E1gzx&access_type=offline"

I think I set up the wrong URI somehow. Could someone tell me the correct way of setting up the OAuth consent screen section? For my project, I ran my app on localhost:5000 then deployed it to Heroku (mysite.herokuapp.com). I'm not sure what I need to put on "Authorized domains" field and "Application homepage link". (I didn't add anything under " Add Scope".)

Also under "credentials" section, what URI I should put in the "Authorized JavaScript origins" and "Authorized redirect URIs" field? So far I put "http://localhost:5000" and it's not accepting this format. So left it blank but I got this error 400 at the end. For "type", I chose "web application". Should I choose web server instead?

Thanks!

0

There are 0 answers