IOS App Authentication Error

I have just succesfully rebuilt my hassio install following the death of the memory card on the RPI and tried to reconnect the mobile app at which point I get Error: invalid client id or redirect uri and then Authentication Controller Error 1 as per the following:

I am not using an external URLand I am only connecting across an internal network. I have tried all combinations of URI, URL, IPs and auth settings (removed the app and reinstalled) and results are the same error messages as above.

The settings in the app are shown below -

I am going round in circels on this one - can anyone help?

Try disabling IPv6 on your Home Assistant machine.

i will check

Is this something that is enabled in Hassio? Do you know?

IPV6 is not enabled in HASSIO.

The problem appears to be with the App. I have tried with an ipad, initially the App connects and I can see the dashboard. After a short time it bails out and the previously mentioned error occurs.

When I connect using safari or firefox on the phone or ipad everything works as expected - but the App does not, there is definitely a problem with App.

Are there debug logs available within the App or elsewhere to enable better diagnostics?

There is no logging function built into the version you are on, 1.5. May I suggest you try out the 2.0 beta which has an entirely new way of interacting with Home Assistant which should fix these issues?

VI have installed TestFlight and updated to the beta still no joy in connecting same issues as before.

Having said that I have poked around in the interface a little and found the link that the app is trying to connect to:

192.168.x.x:8123/frontend_latest/authorize.html?response_type=code&client_id=https://home-assistant.io/iOS&redirect_uri=homeassistant://auth-callback

Whereā€™s as if I use all is ok
192.168.x.x:8123/lovelace/default_view

I assume the app is built on the underlying safari code (but Iā€™m not a coder so itā€™s a pure guess) given its working ok in safari I can only assume something isnā€™t correct in the way itā€™s trying to authenticate in the app

Truly donā€™t know whatā€™s going on here

Can you please update to 0.92.2? It finally contains logging improvements that will give you a better idea of why you are receiving the ā€œError: invalid client id or redirect uriā€ error.

Iā€™m having the same issue with Hass.io and just updated to 0.92.2. The logs say:
OS error while looking up redirect_uri https://home-assistant.io/iOS/beta-auth: Try again

Thx Robbie

I have updated to 92.2, the original error persists on my iPhone and I get the following in the HA log

2019-05-06 17:10:28 ERROR (MainThread) [homeassistant.components.auth.indieauth] OS error while looking up redirect_uri https://home-assistant.io/iOS: Try again

Without doing anything the hass companion 1.5.1 is running (again) on the iPad although it thinks the HA version is 91.3 ?!?!

OS error is exactly that. I believe it may be due to a broken IPv6 config, please try disabling v6 and retrying.

Ok Iā€™m struggling here, I run hassio and as far as I can tell it does not have IPV6 enabled within the container (not present in the detail of Ifconfig)

Can you give any pointers if Iā€™m looking in the wrong place ?

Iā€™m getting the same errors too. Tried 1.5.1 and beta 2.0 of the iOS app, and I have IPv6 disabled on my router. Iā€™m running Home Assistant on a Mac Mini. Any help would be appreciated.

Try to reboot your router
https://github.com/home-assistant/home-assistant-iOS/issues/325

Did that, and I disabled IPv6 on my router and Mac Mini. No change :frowning:

Same problem router isnā€™t in the equation as Iā€™m direct connected on the same lan

Robbie any additional thoughts ?

@HomeAutoFred Youā€™ll need to ping me on Discord so I can help you debug one on one. @PolarHacker, you too.

Oh also, the problem here isnā€™t with your device communicating to Home Assistant, itā€™s with Home Assistant trying to download the page at https://home-assistant.io/ios/beta-auth.

Iā€™m not able to disable IPv6 on my router; https://community.bt.com/t5/Home-setup-Wi-Fi-network/IPv6-disable-on-Smart-Hub/td-p/1856066

Yes, I know there are several solutions to this, and some of these I can implement and probably will. But does this mean that if youā€™re a BT customer (lots of people in the UK are) and you are not a Nabu Casa subscriber (I am) that you wonā€™t be able to use the iOS Companion app?

Incidentally Iā€™ve just tried my Nabu Casa URL in the latest version of the Beta (58) and get a SSL error in the app. Sorry Robbie!

After some thinking and debugging over the weekend I appear to have found the source of my problems and fixed my issue.

Drum roll, cymbal crashā€¦ it was a network problem, not ipv6 but ipv4!!

I use hassio, the new version of hassio uses hassos, to set the network you can reserve a DHCP address, create a network config file or use the nmcli in docker. For expediency I initially used the nmcli and set up my network stack. While this created a functioning install of hass, it wasnā€™t really functioning?!?!

So what tipped me off? Following a reboot yesterday I have started to see a number of internet integrations failing, I immediately suspected router issues etc but worked out quickly that the smoking gun was back with hass, while it had the correct network info it wasnā€™t working correctly. So long story short I followed the instructions for option 2 above and ā€˜bangā€™ everything is now functioning as it should.

I think there may be a problem with the way the host passes network details to the container with my version of hassio BUT this is an assumption rather than a position of knowledge and likely a glitch, however the hard coded method has resolved the issues.

Thanks to Robbie and others that have contributed

2 Likes

How exactly did you fix it- you said ā€œOption 2,ā€ but I havenā€™t been able to follow what you mean by that. I am experiencing the very same issue.