Need to give possibility for script to read my gmail account.
There is a VM in google cloud with api. If api is called, the script goes to gmail, gets mails and processes them, returning result as api response.
I run api, and when I'm making request to this api from localhost, there is a message in api logs: Please visit this URL to authorise this application:
https://accounts.google.com/o/oauth2/auth?response_type=...
After opening this URL in web browser I get 400 error:
Error: redirect_uri_mismatch
The redirect URI in the request, http://localhost:34067/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/...
I have created OAuth 2.0 Client ID, downloaded client_secret.json file and put it on my server. I thyed different redirect urls in OAuth 2.0 Client ID settings, but nothing helped.
How to avoid 400 error on visiting google oauth url?