-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error: The request body must contain the following parameter: 'refresh_token' #8
Comments
This was happening to me too when the tokens expired after an hour. I realised that it wasn't getting a refresh_token within the token itself. After googling and going through the source code, I found out that you have to pass
class ToDoConnection:
...
_scope: str = 'openid Tasks.ReadWrite offline_access'
... After the change above, I got a refresh_token. I still need to wait an hour to check if it refreshes correctly but I'd imagine so. So yeah... Thought I'd post this here whilst I wait. I'll edit this comment otherwise. |
Sorry for ignoring, just reverted the scope to |
OAuth2 fails because of this error
Traceback (most recent call last):
File "/volume1/homes/stepic/notion-bot/notion-bot.py", line 32, in
lists = todo_client.get_lists()
File "/volume1/homes/stepic/notion-bot/lib/python3.9/site-packages/pymstodo/client.py", line 307, in get_lists
self._refresh_token()
File "/volume1/homes/stepic/notion-bot/lib/python3.9/site-packages/pymstodo/client.py", line 292, in _refresh_token
new_token = oa_sess.refresh_token(token_url, client_id=self.client_id, client_secret=self.client_secret)
File "/volume1/homes/stepic/notion-bot/lib/python3.9/site-packages/requests_oauthlib/oauth2_session.py", line 452, in refresh_token
self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
File "/volume1/homes/stepic/notion-bot/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 427, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File "/volume1/homes/stepic/notion-bot/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in parse_token_response
validate_token_parameters(params)
File "/volume1/homes/stepic/notion-bot/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 448, in validate_token_parameters
raise_from_error(params.get('error'), params)
File "/volume1/homes/stepic/notion-bot/lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 399, in raise_from_error
raise cls(**kwargs)
oauthlib.oauth2.rfc6749.errors.InvalidClientIdError: (invalid_request) AADSTS900144: The request body must contain the following parameter: 'refresh_token'.
The text was updated successfully, but these errors were encountered: