IOS App Authentication Error

Assuming that you are using the latest image of HassIO which is powered by HassOS then if you follow the guide https://www.home-assistant.io/hassio/installation/ this will get you going.

I created my config direct on the SD Card as per the instructions under Bullet No 3 sub bullet 2. If you follow the how to link it provides a generic configuration. Note if you do it this way you will have to mount the SD card on a computer. You can copy and paste this direct into your config file, and then change the relevant section from auto to manaul for static IPs.

My config file looks something like the following for a static ethernet connection

[connection]
id=my-network
uuid=d55162b4-6152-4310-9312-8f4c54d86afa
type=802-3-ethernet

[ipv4]
method=manual
address=192.168.1.111/24;192.168.1.1
dns=8.8.8.8;8.8.4.4;

[ipv6]
addr-gen-mode=stable-privacy
method=auto

For the static address (in the IPV4 block) the first IP range followed by /24 will be your chosen static IP, the second IP is your routers gateway address.

1 Like

Gotcha- I did follow that and had something similar. Iā€™ve been told my problem is with ipv6- should this config be setup differently to disable ipv6?

I have to be honest and say I dont know, my problem appeared to be with a corrupt IPV4 config.

Robbie initially asked me to check/ disable IPV6. I checked by SSH into hassio and ran ifconfig to check for IPV6. In my ifconfig output IPV6 it was not present so I didnā€™t need to disable it in the network config; I also do not have IPV6 running anywhere in my setup.

I did however research it and found that the first and obvious piece of advice is to disable IPV6 in your network, starting with your ISP router.
Given that hassos is still developing there is not a lot information readily available to help, the only link that I found in the forums that looked plausible for disabling IPV6 is this one https://www.leowkahman.com/2016/03/19/disable-ipv6-raspberry-raspbian/

I have not tried to apply this as I have fixed my problem but it might point you in the right direction. If you do get a fix it would be worthwhile posting it to help others

Is a complete reinstall required to use this solution? Is the config only picked up with the first boot? Seems like one should be able to use ifconfig to make the changes, right?

No a complete rebuild is not required and yes the config is picked up on 1st boot and every other boot.

I recall reading a ā€˜to doā€™ by the dev of hassio to include a gui to make network set up easier within hassio but that has not yet shipped.

In regards to setting a static using ifconfig I honestly do not know!

The ā€˜officialā€™ methods are detailed in the manual page link that I posted but there may be other ways of achieving the same outcome.

Iā€™ve also been getting this too since I tried to replace my Mac mini with a MacBook Pro. IPv6 is disabled on my router and I can access HA fine by browser. The issue is with both the App Store app and the beta (58). @robbiet480 Iā€™d love to help troubleshoot if you have time.

@robbiet480 @PolarHacker @HomeAutoFred

OK I figured out the problem. For me it was I forgot to read at the end of the Python 3.7.3 install where it says to install the certificates. Iā€™ve done this before and this time Iā€™m going to make sure I write this down in my install guide so I donā€™t waste more time with this VERY simple fix because of my inability to read instructions.

So if anyone else is still experiencing this, reinstall Python and in the folder install certificates using the Install Certificates.command file in the folder

2 Likes

To be clear for others, this only applies if you are on Mac & install Python via python.org packages instead of something like Homebrew.

3 Likes

The past few days Iā€™ve been migrating from my RP3B+ to Virtualbox.
Everything is up and running. I have remote access via DuckDNS and Nabu Casa.
However, I am getting the same error mentioned above when trying to connect the ios app. I have tried both my duckdns address and the nabu casa address.

Funny thing is, if I use Chrome/safari on ios, I can log in fine.

Any ideas please?

EDIT: I keep reading about issues with ipv6 and Hassio not being able to access https://home-assistant.io/iOS
I keep seeing this in my HA log:
Timeout while looking up redirect_uri https://home-assistant.io/iOS

Surely thereā€™s something simple Iā€™m missing with virtualbox network setup?

I had the same problem. I could log into HA from my iphone using safari or chromeā€¦

https://mydomain.duckdns.org:8123

but I couldnā€™t get to the login page using the Home Assistant Appā€¦

iphone: 12.3.1 HA for IOS: 1.5.1

All was working fine until I enabled ā€œletā€™s encryptā€.

UPDATE: Itā€™s workingā€¦user error! I went back and checked that the config file had the correct

base_url: xxxxx.duckdns.org:8123

Confirmed that I set port forwarding correctly: 8123 external traffic goes to hassio 8123 port

I then opened HA Assistantā€¦URL: https://xxxxx.duckdns.org:8123 ; legacy authentication OFF show advanced settings OFF and selected Validate and save connection. The logon screen miraculously appeared.

My really dumb error:I had base_URL wrong in configuration.yaml. I forgot to update the xxxxx portion.

Can you go into a little more detail? Iā€™m having the same issues now that Iā€™ve moved from Hass.io to Home Assistant running on a Mac mini. I have a Lets Encrypt certificate through NGINX Proxy Manager pointing to https://homeassistant.mypersonaldomain.com. I have HA running on Python 3.7.3 in a virtualenv.

I installed Python 3.7.3 with pyenv. Iā€™m not seeing that Install Certificates file in the folder for the virtual environment I created for Home Assistant. Where should I look?

@emergent first off, welcome to the community!! So the file youā€™re looking for is in the install package for Python. If you download it again from their website, look for it inside the installation folder.

Adding one more potential reason that you can encounter this problem with ā€œError: Invalid client id or redirect uriā€. I solved or at least worked around my problem after reading this post and figured it might help someone else that encounters this issue.

I am running .94.4, fresh install and manual config (not pulled from backup which was .82.X ā€¦ I think). The issue in my case impacted both 1.5.1 or 2.0 Beta.

Workaround: Shutdown AdGuard Add-on, might have to go back to pihole as I know there is ability there to disable IPv6.

It looks like AdGuard has IPv6 enabled and based on this thread this might be playing into my problem. At this point there does not appear to be any current method to disable IPv6 on AdGuard, though I am planning to request this enhancement.

I solved this issue disabling Dnsmasq addon

hi guys

i am having the same issue.

please advice how i can disable ipv6 in hass.io?

nvm, i disabled ipv6 in windows 10, reinstall hassio and everything worked !

Iā€™ve been experiencing intermittent problems with my environment since switching to AdGuard Home for DNS rather than my router for local DNS. Iā€™ve switched back to my router DNS and will monitor the situation.

Thanks for this info. I admit I got in a hurry and did not install the certificates at the end. I just reinstalled Python and certificates and trying again now.

My findings so far:

  1. Using IOS app since yesterday when manually set to use local router DNS has been rock solid.
  2. Unable to connect to remote instance when on mobile network from iPhone.
  3. Issue affects both the iOS app and browsing from Chrome or Safari on iPhone.
  4. Looking at AdGuard Home DNS query logs, my iPhone appears to be making DNS queries for the DNS CNAME which my Home Assistant host points to.
  5. Disabling IPv6 on the server which is running the Home Assistant environment made no difference.

Regarding point 4 I have changed the DNS record for my Home Assistant server from CNAME to an A record with my Dynamic DNS provider. Will see if this makes any difference and report back.

So I finally got to the bottom of the issues I was having.

Local connectivity:

  • iOS appears not to like CNAMEs for home assistant with some DNS servers. My previous router DNS server this was not a problem. When using AdGuard Home running on my local network the caused problems.
  • Resolution was to change the CNAME for the Home Assistant domain to an A record

External connectivity:

  • Turns out NGINX docker containers need you to explicitly state IP addresses you wish to expose ports from.

So all working for now - hopefully :crossed_fingers: