Home Assistant Community

IOS App Authentication Error

#1

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?

#2

Try disabling IPv6 on your Home Assistant machine.

#3

i will check

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

#4

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?

#5

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?

#6

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

#7

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.

#8

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

#9

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 ?!?!

#10

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

#11

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 ?

#12

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.

#13

Try to reboot your router

#14

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

#15

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

Robbie any additional thoughts ?

#16

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

#17

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.

#18

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!

#19

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

1 Like
#20

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.