Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get refresh token for my application #315

Closed
rahul3103 opened this issue Jun 7, 2018 · 0 comments
Closed

How to get refresh token for my application #315

rahul3103 opened this issue Jun 7, 2018 · 0 comments

Comments

@rahul3103
Copy link

rahul3103 commented Jun 7, 2018

Hey i am trying to access Google Drive via this app and I am trying to upload and list files. But I am facing issue when the access_token expires after an hour. from where should I get refresh_token.
Here is the repo: https://github.com/rahul3103/test_google_login

google.auth.exceptions.RefreshError
google.auth.exceptions.RefreshError: The credentials do not contain the necessary fields need to refresh the access token. You must specify refresh_token, token_uri, client_id, and client_secret.

Traceback (most recent call last)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/rahul/projects/personal/code/app.py", line 57, in home
fields="nextPageToken, files(id, name)"
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/googleapiclient/http.py", line 835, in execute
method=str(self.method), body=self.body, headers=self.headers)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/googleapiclient/http.py", line 162, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/google_auth_httplib2.py", line 213, in request
self.credentials.refresh(self._request)
File "/Users/rahul/.virtualenvs/drive/lib/python3.6/site-packages/google/oauth2/credentials.py", line 129, in refresh
'The credentials do not contain the necessary fields need to '
google.auth.exceptions.RefreshError: The credentials do not contain the necessary fields need to refresh the access token. You must specify refresh_token, token_uri, client_id, and client_secret.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant