Skip to content

refresh_cb returning Error code 401 #61

@ethanopp

Description

@ethanopp

Code has been working now for over a year, stopped working all of the sudden...wondering if something has changed

Code is pretty straightforward, user clicks 'Allow', I parse query params for the code and then pass to the .get_credentials() function.

The code is being parsed correctly so it seems something with the function is off...

query_params = urlparse.urlparse(search)
creds = withings_auth_client.get_credentials(parse_qs(query_params.query)['code'][0])

Here is the error I'm getting

Traceback (most recent call last):
  File "/Users/ethan/PycharmProjects/fitly/src/fitly/pages/settings.py", line 1234, in update_tokens
    creds = withings_auth_client.get_credentials(parse_qs(query_params.query)['code'][0])
  File "/Users/ethan/PycharmProjects/fitly/venv/lib/python3.7/site-packages/withings_api/__init__.py", line 376, in get_credentials
    include_client_id=True,
  File "/Users/ethan/PycharmProjects/fitly/venv/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 360, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/Users/ethan/PycharmProjects/fitly/venv/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/Users/ethan/PycharmProjects/fitly/venv/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response
    validate_token_parameters(params)
  File "/Users/ethan/PycharmProjects/fitly/venv/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

Also, when trying to print(creds) I get invalid syntax (<unknown>, line 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions