Home Assistant + Authentik OIDC SSO: The Modern Setup That Actually Works with the Companion App (2026)

Status: WORKING — October 2026
Last reviewed: 22 October 2026
Applies to: Home Assistant OS, Authentik, Traefik, OpenID Connect and the Home Assistant Companion App.

This is the modern replacement for my original Authentik Forward Auth and Home Assistant Companion App workaround. It uses OIDC authentication directly inside Home Assistant, without needing two hostnames or the archived hass-auth-header integration.

I absolutely love having Authentik handle SSO across my homelab. For a long time, however, Home Assistant was the awkward exception.

My original Home Assistant, Authentik and Traefik article explained how I got everything working using two Traefik routers, Authentik Forward Auth and hass-auth-header.

That solution worked, including the Companion App, but it was a bit of a hack. Now there is a much cleaner way to do it using OpenID Connect (OIDC).

In October 2026 I finally migrated my own setup. The browser login works, the Companion App works, and everything goes through a single Home Assistant hostname. Of course, I ran into a few problems along the way, so I’ve included those fixes too.

What changed?

The original hass-auth-header integration was archived in October 2025. That component relied on Home Assistant accepting an authentication username supplied through an HTTP header.

The maintained OpenID Connect for Home Assistant project offers a different approach.

  • Authentik acts as an OIDC identity provider.
  • Home Assistant handles its own authentication sessions.
  • Traefik is just a normal HTTPS reverse proxy.
  • The browser and Companion App can use the same hostname.
  • No separate Companion App bypass route is required.
  • No hass-auth-header integration is required.

The new architecture

Browser / Companion App
          |
          v
 https://home.richay.au
          |
          v
     Traefik HTTPS
          |
          v
    Home Assistant
          |
     OIDC login flow
          |
          v
 https://auth.richay.au
          |
          v
       Authentik


Instead of Authentik intercepting requests at Traefik, Home Assistant redirects the user to Authentik when authentication is required.

Important: Removing Authentik Forward Auth does not disable Home Assistant authentication. Home Assistant still requires an authenticated session. OIDC simply changes how that authentication is performed.

1. Before starting

Before changing anything, take a Home Assistant backup and keep a copy of your existing Traefik dynamic configuration.

  • Home Assistant should be accessible through HTTPS.
  • Authentik should already be running.
  • Traefik should already be proxying Home Assistant.
  • You will need HACS to install the OIDC integration.
  • You should have a working local Home Assistant administrator account available for recovery.

If you’re migrating from my old setup, leave the existing Forward Auth rules and hass-auth-header configuration alone until OIDC has been configured. Keep an existing administrator session open during testing.

2. Install OpenID Connect for Home Assistant

Open HACS and install OpenID Connect for Home Assistant by Christian Goossens.

The integration is also known as auth_oidc. This is a different integration from the original auth_header component.

After installing, restart Home Assistant Core.

ha core restart


Then navigate to Settings → Devices & Services → Add Integration and search for OpenID Connect/SSO Authentication.

Select Authentik as the provider. We’ll return to this configuration after creating the Authentik application.

3. Create the Authentik application

Open Authentik and navigate to Applications → Applications. Create an application and configure a new OAuth2/OpenID Connect provider.

I used the application slug home-assistant. For my setup I used a confidential client, with a client secret and an RS256 signing key.

The important settings are:

  • Provider type: OAuth2/OpenID Connect
  • Client type: Confidential
  • Signing key: RS256 signing key
  • Redirect URI type: Strict / Authorization
  • Redirect URI: Your Home Assistant OIDC callback address

For my setup, the redirect URI is:

https://home.richay.au/auth/oidc/callback


Don’t make my mistake: I initially entered the callback URL under the Logout URI field instead of Redirect URIs. Make sure it goes into the Authorization Redirect URI field. The logout field can be left empty for this basic configuration.

Save the provider and make note of the Client ID and Client Secret. Never publish the secret.

For additional provider configuration details, see the Authentik Home Assistant integration documentation.

4. Configure OIDC in Home Assistant

Return to the Home Assistant OIDC integration setup and select Authentik.

The integration asks for the OIDC discovery URL. Mine is:

https://auth.richay.au/application/o/home-assistant/.well-known/openid-configuration


Replace the hostname and provider slug with your own values.

The discovery endpoint returns details such as the issuer, authorization endpoint, token endpoint and supported authentication methods.

Once validation succeeds, enter the Client ID and Client Secret from Authentik, then configure the user and role mapping options.

Existing users: Make sure the OIDC identity gets linked to the correct existing Home Assistant account. Incorrect linking may create a new account without your normal permissions. Preserve a local administrator login and disable temporary automatic account linking once migration is complete.

5. Troubleshooting — Home Assistant couldn’t reach Authentik

This is where my migration got interesting.

Home Assistant kept reporting Connection failed — Unable to connect to the OIDC provider.

The Authentik provider was correctly configured, but Home Assistant couldn’t resolve the Authentik hostname.

I tested the connection from the Home Assistant Studio Code Server terminal:

curl -i --max-time 10 \
  https://auth.richay.au/application/o/home-assistant/.well-known/openid-configuration


The response was:

curl: (6) Could not resolve host: auth.richay.au


This was a DNS problem, not an Authentik credential or Traefik problem.

Because I use AdGuard Home and split DNS, I needed to make sure Home Assistant Supervisor was using the correct internal DNS servers.

First, I checked Supervisor’s DNS configuration:

ha dns info


It listed Cloudflare’s 1.1.1.1 resolver along with my two internal DNS servers, 10.77.69.100 and 10.77.69.97.

I explicitly configured those two local DNS servers as Supervisor upstreams:

ha dns options \
  --servers dns://10.77.69.100 \
  --servers dns://10.77.69.97


Important: These are my internal DNS server addresses. Replace them with your own. Also make sure your local DNS actually resolves the Authentik hostname. Public DNS resolvers won’t necessarily know about private split-DNS records.

After applying that change, the same curl test returned HTTP/2 200 with the Authentik OIDC discovery JSON.

One final catch: Studio Code Server runs separately from Home Assistant Core. Even though DNS worked in the terminal, the integration still failed validation until I restarted Core.

ha core restart


After that, OIDC validation finally succeeded.

6. Simplify Traefik

Now for the best part of the entire migration.

My previous Traefik configuration had a protected router for authentication paths and a separate unprotected route for the Companion App.

With OIDC configured inside Home Assistant, those special rules are no longer required.

My new Traefik router is simply:

home:
  entryPoints:
    - "https"
  rule: "Host(`home.richay.au`)"
  tls: {}
  service: home


That’s it. No Authentik Forward Auth middleware, no special path matching, and no second hostname for the Companion App.

This example belongs inside the existing http.routers section of your Traefik dynamic configuration. It reuses my existing home service and backend configuration.

Traefik should automatically reload a watched dynamic configuration file after saving. Make sure the new router is active before removing the old configuration permanently.

7. Home Assistant reverse-proxy settings

Home Assistant 2026.8 moved HTTP server and reverse-proxy settings into its interface.

Navigate to Settings → System → Network → HTTP server.

Make sure Home Assistant is configured to trust forwarded headers from the reverse proxy that actually connects to it.

  • Enable Trust X-Forwarded-For where required.
  • Add the actual reverse-proxy IP address to Trusted Proxies.
  • Use the correct Home Assistant HTTP listening port.
  • Avoid trusting an unnecessarily broad network range.

Your reverse proxy might connect from a Docker bridge address or another internal IP. Use the address Home Assistant actually sees, rather than blindly trusting the entire home network.

See the Home Assistant HTTP integration documentation for more information.

8. Testing the new authentication

Before removing the previous authentication configuration, test everything using a private or incognito browser window.

  1. Open your Home Assistant HTTPS hostname.
  2. Select the Authentik/OIDC login method.
  3. Complete authentication through Authentik.
  4. Confirm Home Assistant opens successfully.
  5. Check that you are signed into your original Home Assistant user.
  6. Verify administrator permissions and existing dashboards.
  7. Repeat the process with the Home Assistant Companion App.

The Companion App should now be able to use the same address as the browser:

https://home.richay.au


There is no longer any need for my previous home-api.richay.au Companion App bypass hostname.

9. Companion App notifications and device registration

One unexpected problem during my migration was that the Companion App’s notification action changed.

Some automations still referenced my old notification action, but Home Assistant no longer recognised it. Spook helpfully flagged the missing action.

The fix was to check the Companion App device registration and the notification action actually registered inside Home Assistant.

On Android, open the Home Assistant Companion App settings and inspect the Device Name and Device Registration sections.

Then, in Home Assistant, open Developer Tools → Actions and search for notify.mobile_app_.

Once the correct notification action is registered, test it before updating your automations.

action: notify.mobile_app_sm_s918b_s23
data:
  title: "OIDC test"
  message: "Home Assistant notifications are working again"


This is an example using my corrected phone model naming. Replace the action with whatever your Companion App actually registers.

If the renamed notification action is missing, restart Home Assistant Core and check again. Device names, entity IDs and notification action names are related but are not necessarily identical.

In my case, I discovered I’d been calling my Galaxy S23 Ultra an S21. Probably a good opportunity to clean up the naming properly!

10. Remove the old authentication setup

Once the new OIDC login works correctly in both the browser and Companion App, the old authentication workaround can be retired.

My previous Home Assistant configuration.yaml contained:

auth_header:
  username_header: X-authentik-username


That configuration is no longer needed for OIDC. After removing it, restart Home Assistant.

The archived hass-auth-header integration can also be removed once nothing else depends on it.

In Traefik, remove the old Home Assistant-specific Forward Auth routing and the unused Companion App bypass route. Keep any Authentik middleware that other services still use.

Do not disable every local authentication method. Keep an emergency Home Assistant administrator login available in case Authentik becomes unavailable.

Troubleshooting

OIDC discovery validation fails

Check the discovery URL, internal DNS and HTTPS certificate validation. Test the endpoint using curl. If it works in Studio Code Server but fails inside the integration, remember that Home Assistant Core is a separate environment.

Redirect URI mismatch

Check that your Authentik provider has the correct strict Authorization Redirect URI ending in /auth/oidc/callback. Do not put this under Logout URI.

Home Assistant shows an unexpected account

Verify user linking and OIDC user mappings. An Authentik identity must map to the correct Home Assistant user if you want to preserve existing permissions and associations.

The browser works but the Companion App doesn’t

Make sure the app uses the correct hostname and that Traefik no longer has a Forward Auth challenge intercepting Home Assistant’s login flow. Test on both Wi-Fi and mobile data.

Automations report unknown notification actions

Check the registered Companion App device name and notification action. Test notifications before editing automations. The Spook integration can help identify broken references.

HTTP 400 Bad Request behind Traefik

Check Home Assistant’s trusted proxy settings, the real source IP of the proxy connection and whether X-Forwarded-For is configured correctly.

Keeping Home Assistant private

OIDC improves authentication, but it does not replace network security.

You can still keep Home Assistant accessible only from your home network or VPN rather than publishing it publicly.

I use Tailscale and split DNS for various services so I can keep convenient hostnames without relying on public access for everything.

I’ve written a separate guide covering this: Tailscale Split DNS by Domain for Secure Home Server Access.

Final thoughts

After running the old two-hostname workaround for quite a while, I’m very happy with the OIDC migration.

The result is a much cleaner configuration:

  • One Home Assistant hostname.
  • Authentik SSO through OpenID Connect.
  • Working Home Assistant Companion App.
  • No hass-auth-header dependency.
  • No special Traefik authentication path rules.
  • No second hostname just to bypass Authentik.

The only real surprises were DNS resolution inside Home Assistant and cleaning up my Companion App notification registration afterward.

If you’re starting fresh in 2026, I’d use OIDC rather than build the original Forward Auth workaround. And if you’re migrating an existing setup, make sure everything works before removing the old configuration.

Sometimes the best homelab upgrade is deleting half the configuration you previously needed to make something work!

References and further reading

Leave a Reply

Your email address will not be published. Required fields are marked *