home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.81k stars 30.06k forks source link

Login to Home Assistant remotely is not working #16355

Closed hiol83 closed 5 years ago

hiol83 commented 6 years ago

Home Assistant version: 0.77.2 under Hass.IO

If i try to login from LAN i can create user and log in correctly. If i try from "outside" i get this

screenshot

this is due to the new auth system: https://www.home-assistant.io/blog/2018/08/29/release-77/

bachya commented 6 years ago

Please fill out the issue template; without that info, there's no way we can help you.

hiol83 commented 6 years ago

Ok i've updated the issue

awarecan commented 6 years ago

Any error log from either back end or browser console?

hiol83 commented 6 years ago

Ok so from google chrome console i can see this error:

/auth/login_flow:1 Failed to load resource: the server responded with a status of 400 (Bad Request)

In the log:

2018-09-03 22:08:45 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from XX.XX.XX.X

hiol83 commented 6 years ago

Updated HASSIO to 0.77.3 and no i 've the same screenshot but with "Error: invalid client id or redirect uri" instead of "START OVER"

awarecan commented 6 years ago

Yes, we have a slightly better error handling in 0.77.3

Can you post the URL in your browser, the error message itself is very clear that HA believe either your client id or redirect URL is not valid. Please do not mask the URL, since every character matter to analysis your problem.

You can PM me your URL if you don't want to exposure your privacy.

awarecan commented 6 years ago

BTW, which language are you using? The translation breaked our markdown syntax

hiol83 commented 6 years ago

Hi and thanks for the reply. I'm using Italian as language. How to send you a PM? sorry, but I've never done.

awarecan commented 6 years ago

You can @ me in discord https://discord.gg/QrNFMq

hiol83 commented 6 years ago

Sorry i've been away for the weekend. Now i see that the link is no more valid...could be? Can u send me it again? I will write you the link asap and really thanks for your help

awarecan commented 6 years ago

Are you using IP address to access remotely? We do not support remote access by IP address, you have to use domain name.

hiol83 commented 6 years ago

Yes i've a fixed ip adress so i connect directly to it. So i should solve with a dns service?

hiol83 commented 6 years ago

Anyway here it's not written that remote access by IP is not supported: https://www.home-assistant.io/docs/configuration/remote/

awarecan commented 6 years ago

If you do not have a domain name, you can edit hosts file to fake one. I am writing up document about it, and will include a change to remote document as well.

See: https://github.com/home-assistant/home-assistant.io/pull/6244

hiol83 commented 6 years ago

Ok thanks. I don't have it because i've payed for a business internet service and so i've a fixed/static ip. I try to do a free dyndns service even if seems a bit nonsense

hiol83 commented 6 years ago

Ok i've tryied with a dns service and it works. Do you know a free dns service? I've tryed with noip.com but it last only 30 days

hiol83 commented 6 years ago

I'm looking at the host file but what should i write? My public ip and a fake name? And then? Should i be able to connect remotely as i was used to do...so with my public static ip adress?

awarecan commented 6 years ago

See: https://deploy-preview-6244--home-assistant-docs.netlify.com/docs/authentication/#error-invalid-client-id-or-redirect-url

We also recommend duckdns.org as free dns service in our document

hiol83 commented 6 years ago

Wonderful! I've done with duckdns and it's all working as expected. Many thanks to you @awarecan for your work and for your assistance!