openviess/PyViCare

v3 API Getting OAuth does not work.

Closed this issue · 1 comments

k0re commented

See also home-assistant/core#107258 - v3 API does not provide successful OAuth Bearer token.

Traceback (most recent call last):
  File "D:\PyViCare-2.32.0\PyViCare-2.32.0\test.py", line 10, in <module>
    vicare.initWithCredentials(email, password, client_id, "token.save")
  File "D:\PyViCare-2.32.0\PyViCare-2.32.0\PyViCare\PyViCare.py", line 26, in initWithCredentials
    self.initWithExternalOAuth(ViCareOAuthManager(
                               ^^^^^^^^^^^^^^^^^^^
  File "D:\PyViCare-2.32.0\PyViCare-2.32.0\PyViCare\PyViCareOAuthManager.py", line 30, in __init__
    oauth_session = self.__restore_oauth_session_from_token(token_file)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PyViCare-2.32.0\PyViCare-2.32.0\PyViCare\PyViCareOAuthManager.py", line 38, in __restore_oauth_session_from_token
    return self.__create_new_session(self.username, self.password, token_file)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\PyViCare-2.32.0\PyViCare-2.32.0\PyViCare\PyViCareOAuthManager.py", line 68, in __create_new_session
    raise PyViCareInvalidConfigurationError(response.json())
PyViCare.PyViCareUtils.PyViCareInvalidConfigurationError: (PyViCareInvalidConfigurationError(...), 'Invalid credentials. Error: invalid_request. Description: Client not registered.. Please check your configuration: clientid and redirect uri.')

When you change the API Endpoint to v2 it works.

k0re commented

It seems like its working again.