Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth_header sign on working on desktop but not in Home Assistant mobile app #335

Open
xxxarmitagexxx opened this issue Oct 24, 2024 · 0 comments

Comments

@xxxarmitagexxx
Copy link

xxxarmitagexxx commented Oct 24, 2024

Hi,

I have setup the auth_header sign on with Authentik and can log just fine on desktop.
On Mobile, I am getting the Authentik prompt, successfully sign in in Authentik but then am getting an Unable to connect to Home Assistant error.

Looking at the debug logs, it appears that in both the desktop and mobile case, auth_header is successfully logging in but in the case of the Mobile set up I am getting an additional error.
The two use cases have the exact same debug lines, with the Mobile having the last warning line in addition:

2024-10-24 10:59:20.114 DEBUG (MainThread) [custom_components.auth_header] <CIMultiDictProxy('X-authentik-username': 'armitage', 'X-authentik-groups': 'authentik Admins|Portainer\xa0Admins|Arr Admins|Family Users|Family Admins|Grafana Admins', 'X-authentik-email': 'email.com', 'X-authentik-name': 'My Name', 'X-authentik-uid': '2578f0b95145127b0b75230e33b8a8cc49fb61f25e65d78905da3b60ffbb7f04', 'Remote-User': 'armitage', 'Remote-Email': '[email protected]', 'Remote-Name': 'Matthieu Rosset', 'Host': '192.168.10.82:8123', 'Content-Length': '127', 'cf-ray': '8d75ae269c32a886-SYD', 'X-Forwarded-For': '103.214.222.74', 'Accept': '*/*', 'Accept-Language': 'en-AU,en-US;q=0.9,en;q=0.8', 'Accept-Encoding': 'gzip, br', 'cf-ipcountry': 'AU', 'X-Forwarded-Proto': 'https', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'cf-visitor': '{"scheme":"https"}', 'sec-fetch-site': 'same-origin', 'x-requested-with': 'io.homeassistant.companion.android', 'cf-connecting-ip': '103.214.222.74', 'Origin': 'https://homeassistant.mc-panda.com', 'priority': 'u=1, i', 'cdn-loop': 'cloudflare; loops=1', 'sec-ch-ua-platform': '"Android"', 'User-Agent': 'Mozilla/5.0 (Linux; Android 14; SM-S908E Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/129.0.6668.100 Mobile Safari/537.36 Home Assistant/2024.10.3-14058 (Android 14; SM-S908E)', 'sec-ch-ua': '"Android WebView";v="129", "Not=A?Brand";v="8", "Chromium";v="129"', 'Content-Type': 'text/plain;charset=UTF-8', 'sec-ch-ua-mobile': '?1', 'Cookie': 'authentik_proxy_dHtdDSoh=MTcyOTcyNzg4OXxOd3dBTkVsVU1sTXpXRVpIUzFkUU5FVktURUkzUkRSR05FcFdSa2xIU0U1SlRFdFVVa0ZUUWpSVFJsTkNWazVFVTFCUVFrZENRbEU9fLhMEyEXdxqknBNJsgIhUsN3Q_BUIBZDijZbBFDitg20')>
2024-10-24 10:59:20.114 DEBUG (MainThread) [custom_components.auth_header] Got actual IP [Reverse Proxy docker IP]
2024-10-24 10:59:20.114 DEBUG (MainThread) [custom_components.auth_header.headers] Validating access for IP: [Reverse Proxy docker IP]
2024-10-24 10:59:20.114 DEBUG (MainThread) [custom_components.auth_header.headers] Checking user: My Name
2024-10-24 10:59:20.114 DEBUG (MainThread) [custom_components.auth_header.headers] Found username in credentials: My Username
2024-10-24 10:59:20.114 DEBUG (MainThread) [custom_components.auth_header.headers] Username match found, finishing login flow
2024-10-24 10:59:22.572 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from (WAN IP). Requested URL: '/api/mobile_app/registrations'. (Home Assistant/2024.10.3-14058 (Android 14; SM-S908E))

I have read the few topic discussing issues back in 2022 setting up auth_header to get it to work with the HomeAssistant mobile app but could not figure out a fix.

Any idea on how to get around it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant