Akhil Vempali
Akhil Vempali

Reputation: 21

Google API OAuth2.0 quickstart.py

When I use Quickstart.py code sample given in Google API, I am getting this error. Any thoughts as to why this error is generated ? link:https://developers.google.com/google-apps/calendar/quickstart/python (I have already updated oauth2cilent module)

/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/_helpers.py:255: UserWarning: Cannot access 
storage.json: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
Traceback (most recent call last):
File "/home/akhil/Desktop/TIME_SCHEDULE_UPDATER/quickstart.py", line 
16, in <module>
flow = client.flow_from_clientsecrets('client_secret.json', SCOPES)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/client.py", line 2134, in 
flow_from_clientsecrets
cache=cache)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/clientsecrets.py", line 165, in loadfile
return _loadfile(filename)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/clientsecrets.py", line 126, in _loadfile
return _validate_clientsecrets(obj)
File "/home/akhil/anaconda2/lib/python2.7/site-
packages/oauth2client/clientsecrets.py", line 101, in 
_validate_clientsecrets
prop_name, client_type))
oauth2client.clientsecrets.InvalidClientSecretsError: Missing property 
"redirect_uris" in a client type of "web".

Upvotes: 0

Views: 1186

Answers (1)

Monil Ladha
Monil Ladha

Reputation: 11

In your client_secret.json file add redirect_uris block at the end. Your file should be like: {"web":{"client_id":"foo","project_id":"bar","auth_uri":"foo","token_uri":"bar","auth_provider_x509_cert_url":"foo","client_secret":"bar", "redirect_uris":"http://domain_name _where_you_want_to_redirect/"}}

Upvotes: 1

Related Questions