Skip to content
This repository was archived by the owner on Jan 2, 2020. It is now read-only.
This repository was archived by the owner on Jan 2, 2020. It is now read-only.

Could not authenticate with provided credentials #40

Description

@NordineKB

I've been using Auth2 method of getting tokens, once the generated monzo.json file was made I was using the following line of code which only works for like a day until I get the error below, has anyone had the same or know whats causing it?

oclient = MonzoOAuth2Client(client_id, client_secret).from_json()
client = Monzo.from_oauth_session(oclient)

["Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.6/site-packages/monzo/auth.py", line 107, in make_request
self.session.request(method, url, data=data, **kwargs))
File "/home/ubuntu/.local/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py", line 330, in request
http_method=method, body=data, headers=headers)
File "/home/ubuntu/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "auth_test.py", line 24, in
balance = client.get_balance('acc_00009U1x5f20Agu9wEFoS9')
File "/home/ubuntu/.local/lib/python3.6/site-packages/monzo/monzo.py", line 132, in get_balance
response = self.oauth_session.make_request(url, params=params)
File "/home/ubuntu/.local/lib/python3.6/site-packages/monzo/auth.py", line 110, in make_request
self.refresh_token()
File "/home/ubuntu/.local/lib/python3.6/site-packages/monzo/auth.py", line 160, in refresh_token
auth=HTTPBasicAuth(self.client_id, self.client_secret)
File "/home/ubuntu/.local/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py", line 309, in refresh_token
self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
File "/home/ubuntu/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 415, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File "/home/ubuntu/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 425, in parse_token_response
validate_token_parameters(params)
File "/home/ubuntu/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 432, in validate_token_parameters
raise_from_error(params.get('error'), params)
File "/home/ubuntu/.local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 405, in raise_from_error
raise cls(**kwargs)
oauthlib.oauth2.rfc6749.errors.InvalidClientIdError: (invalid_request) Could not authenticate with provided credentials"](url)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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