AlexxIT / Dataplicity

Public HTTPS access to Home Assistant with Dataplicity service
https://github.com/AlexxIT/Blog
114 stars 4 forks source link

IP address changed #13

Open swiergot opened 2 years ago

swiergot commented 2 years ago

It appears that each request to the wormhole may come from a different proxy IP address (looks like an internal Dataplicity network 10.20/16). This is a problem when logging into HA because of the following check (components/auth/login_flow.py:270):

if flow["context"]["ip_address"] != ip_address(request.remote):
    return self.json_message("IP address changed", HTTPStatus.BAD_REQUEST)

So when the login page is opened, HA stores the remote IP address. Then when credentials are submitted, the IP address is compared with the stored one. Sometimes I get lucky and credentials are accepted, but then the second factor is requested which means yet another IP address check. I've never been able to get past that second check. I had to comment out the code in order to log in successfully.

Have you experienced it as well?

swiergot commented 2 years ago

Ok, I have figured out it's a matter of configuring trusted proxies in HA. I can see the integration sets up 127.0.0.1 as a trusted proxy, but it's not enough. Why is nobody else reporting it? Am I the only one unlucky enough to experience the changing address?

RashaverakGor commented 1 year ago

Confirm. I have the same problem.