Skip to content

multiple errors on login / trying to connect to TI9555X9 coffee maker #46

@Morg42

Description

@Morg42

Hi,

I've been running the singlekey branch for a while now without problems, owning a dishwasher which I can access over hcpy.

System is Devuan daedalus, Python 3.11.2

Now I added a coffee maker (S500 connect, TI9555X9DE/21) and hc-login goes awry...

First error is "missing scheme" on the fourth preauth URL, which I fixed by prepending singlekey_host. (inserting 2 lines before line 123.

Next error is "failed to fetch <Response [307]>", which I fixed by adding code 307 to line 127.

Next error is a relative url for the first return_url, which I again fixed by prepending singlekey_host (again inserting 2 lines before line 136.

The next error is (subtract 4 from linenumbers for inserted code lines):

return_url='https://singlekey-id.com/auth/connect/authorize/callback?client_id=[...]&redirect_uri=https%3A%2F%2Fapi.home-connect.com%2Fsecurity%2Foauth%2Fredirect_target&response_type=code&scope=openid%20email%20profile%20offline_access%20homeconnect.general&prompt=login&style_id=bsh_
hc_01&state=%7B%22session_id%22%3A%22[...]%22%7D&suppressed_prompt=login'
Traceback (most recent call last):
  File "/home/sh/src/hcpy/./hc-login", line 142, in <module>
    headers["RequestVerificationToken"] = r.cookies["X-CSRF-FORM-TOKEN"]
                                          ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/home/sh/.venvs/3.11/lib/python3.11/site-packages/requests/cookies.py", line 334, in __getitem__
    return self._find_no_duplicates(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sh/.venvs/3.11/lib/python3.11/site-packages/requests/cookies.py", line 413, in _find_no_duplicates
    raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
KeyError: "name='X-CSRF-FORM-TOKEN', domain=None, path=None"

I'm guessing it's missing the X-CSRF-FORM-TOKEN cookie from the response. Response cookies include .AspNetCore.Antiforgery. and __Host-F8Mmt.
Why? What can I do? What might I have done wrong?

Anyone able to help? As far as I could see, @CRTified has a similar machine already working...?

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