python-samples icon indicating copy to clipboard operation
python-samples copied to clipboard

oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response.

Open kaori14112 opened this issue 5 years ago • 0 comments

Expected Behavior

It's should be export 10 recents file in google drive

Actual Behavior

Traceback (most recent call last): File "quickstart.py", line 49, in main() File "quickstart.py", line 29, in main creds = flow.run_local_server(port=0) File "/home/backup/.local/lib/python3.6/site-packages/google_auth_oauthlib/flow.py", line 460, in run_local_server self.fetch_token(authorization_response=authorization_response) File "/home/backup/.local/lib/python3.6/site-packages/google_auth_oauthlib/flow.py", line 281, in fetch_token self.client_config['token_uri'], **kwargs) File "/home/backup/.local/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py", line 240, in fetch_token authorization_response, state=self._state File "/home/backup/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 203, in parse_request_uri_response response = parse_authorization_code_response(uri, state=state) File "/home/backup/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 274, in parse_authorization_code_response raise MissingCodeError("Missing code parameter in response.") oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response.

Steps to Reproduce the Problem

  1. I follow this tutorial: https://developers.google.com/drive/api/v3/quickstart/python
  2. I create python file and import credential.json
  3. Run it with python3 quickstart.py and got an error after authentication with browser.

Specifications

  • Python version (Python 3.6.8)
  • OS (Mac/Linux/Windows): Linux Centos 7

kaori14112 avatar Apr 11 '20 04:04 kaori14112