Skip to content

Missing code parameter while fetching token for Google #308

@bdesbiolles

Description

@bdesbiolles

Hello,

I followed the Google Oauth2 example and I managed to get the authorization code
but fetching the token I have the following error:

Traceback (most recent call last):
File "/home/baptiste/Code/Databerries/iap_script/user_auth.py", line 28, in
authorization_response=redirect_response)
File "/home/baptiste/.virtualenvs/iap_script/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py", line 187, in fetch_token
state=self._state)
File "/home/baptiste/.virtualenvs/iap_script/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 174, in parse_request_uri_response
response = parse_authorization_code_response(uri, state=state)
File "/home/baptiste/.virtualenvs/iap_script/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 227, in parse_authorization_code_response
raise MissingCodeError("Missing code parameter in response.")
oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response.

It seems that for Google the parameter is named approvalCode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions