Skip to content

Brand.YALE_HOME auth seems to have broken recently #167

@danricho

Description

@danricho

Hi,
I've recently found that I keep getting 403 to many of the API endpoints which used to work. I cleared my token cache and now I can't get passed the session creation.

My script to re-create:

from yalexs.api import Api
from yalexs.authenticator import Authenticator, AuthenticationState
from yalexs.const import Brand

api = Api(timeout=20, brand=Brand.YALE_HOME)
authenticator = Authenticator(api, "email", "XXXXX", "YYYYY",
                              access_token_cache_file="yaleAuth.txt")

authentication = authenticator.authenticate()

# State can be either REQUIRES_VALIDATION, BAD_PASSWORD or AUTHENTICATED
# You'll need to call different methods to finish authentication process, see below
AuthenticationState = authentication.state

print(f"AuthenticationState: {AuthenticationState}")

Error:

Traceback (most recent call last):
  File "/pythonApp/yale-lock-data-gatherer/updater.py", line 12, in <module>
    authentication = authenticator.authenticate()
  File "/pythonApp/yale-lock-data-gatherer/venv/lib/python3.9/site-packages/yalexs/authenticator.py", line 79, in authenticate
    response = self._api.get_session(install_id, identifier, self._password)
  File "/pythonApp/yale-lock-data-gatherer/venv/lib/python3.9/site-packages/yalexs/api.py", line 52, in get_session
    return self._dict_to_api(
  File "/pythonApp/yale-lock-data-gatherer/venv/lib/python3.9/site-packages/yalexs/api.py", line 287, in _dict_to_api
    _raise_response_exceptions(response)
  File "/pythonApp/yale-lock-data-gatherer/venv/lib/python3.9/site-packages/yalexs/api.py", line 321, in _raise_response_exceptions
    raise err
  File "/pythonApp/yale-lock-data-gatherer/venv/lib/python3.9/site-packages/yalexs/api.py", line 294, in _raise_response_exceptions
    response.raise_for_status()
  File "/pythonApp/yale-lock-data-gatherer/venv/lib/python3.9/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.aaecosystem.com/session

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