Before I had a proper identity layer, logging into my homelab looked a lot like logging into the internet circa 2005. Grafana had an admin account, Netbox had a different admin account, Proxmox had root plus whatever I created that week, and half of the remaining apps had a default password I had definitely meant to change. Every new service was another set of credentials going into the password manager, and taking access away from something meant remembering every place it had been granted. This post is about how I fixed that with Authentik, and the handful of things that tripped me up along the way.
Why Run an IdP at Home?
The obvious answer is convenience: one login, one MFA prompt, done. That is genuinely nice, but it is not really why I did it.
The real reason is the same reason I built the PKI. At work, identity is something that already exists. Someone wired up Okta or Entra years ago and you just click the tile. That makes it very easy to never actually learn how OIDC works, what a client secret is protecting, or why the redirect URI has to match exactly. Running my own identity provider forced me to learn all of that by breaking it repeatedly.
There is also a practical security angle. With one IdP in front of everything, I have one place to enforce MFA, one place to see who logged in where, and one place to turn somebody off. That is a much better story than “I think I changed that password.”
Why Authentik?
I looked at the usual suspects. Keycloak is the heavyweight and very capable, but it felt like more Java than I wanted to babysit for a household. Authelia is lean and great at forward auth, but I wanted a full IdP with a user portal and proper OIDC/SAML provider support. Authentik landed in the middle: it speaks OIDC, SAML, LDAP and proxy auth, has a clean admin UI, and gives users an application portal that looks a lot like the Okta dashboard I stare at every day at work.
For deployment I opted to save a few headaches and simply rolled out a LXC container in Proxmox to proxmox, at some point I may go back and turn it into a docker container with a compose file but this works for now.
How the Pieces Fit Together
Authentik has its own vocabulary, and getting it straight early saves a lot of confusion:
| Concept | What it actually is |
|---|---|
| Provider | How an app authenticates: OAuth2/OIDC, SAML, LDAP or Proxy |
| Application | What the user sees in the portal, linked to exactly one provider |
| Flow | The sequence of steps a login (or enrollment, or recovery) goes through |
| Stage | A single step in a flow: identify the user, check a password, prompt for MFA |
| Outpost | A component that sits in front of apps that cannot do SSO themselves |
| Policy | Rules that decide whether a user can use an application or pass a stage |
Once that clicked, the setup for any new service became a predictable checklist: create the provider, create the application, bind a group policy so only the right people can see it, and plug the client details into the app.
Apps That Speak OIDC
The best case is an application that supports OIDC natively. Grafana and Netbox both fall into this bucket, and they are where I started.
Grafana is a good example of how little config this actually takes. Under [auth.generic_oauth]:
[auth.generic_oauth]
enabled = true
name = Authentik
client_id = <from authentik>
client_secret = <from infisical>
scopes = openid email profile
auth_url = https://auth.int.itsn.network/application/o/authorize/
token_url = https://auth.int.itsn.network/application/o/token/
api_url = https://auth.int.itsn.network/application/o/userinfo/
role_attribute_path = contains(groups, 'Grafana Admins') && 'Admin' || 'Viewer'
That last line is the part I like the most. Grafana roles are driven entirely by Authentik group membership, so making someone an admin is a group change in one place rather than a setting buried inside Grafana. Netbox works the same way through its social auth backend, with groups mapped onto Netbox permissions.
Notice the client secret line. Those secrets live in Infisical alongside everything else, not in a config file sitting in a repo. If I ever have to rotate one, it is a change in Infisical and a redeploy, not a scavenger hunt.
Apps That Don’t
Not everything speaks OIDC. Plenty of self-hosted apps either have no authentication at all or have a single shared login that was clearly an afterthought. For those, Authentik’s proxy provider with an outpost does the work.
The idea is simple: Nginx Proxy Manager already sits in front of most of my web apps, so I configure it to check every request against the Authentik outpost (forward auth) before passing it through. If you do not have a valid session, you get bounced to the Authentik login page first. The app itself never knows anything happened.
It is not as elegant as native OIDC, since the app has no idea who you are and cannot do per-user permissions, but it turns “anyone on the VLAN can open this” into “only people in the right group can open this,” which is a big step up for very little effort.
At the moment only Grafana and Netbox are tied into Authentik however I am pondering more low-risk options to add into it as I am still somewhat wary of putting something like Forgejo behind it and risking breaking a lot of things.
The PKI Dependency
This is where the previous post comes back around. My first attempt at OIDC with Grafana failed with an error that, after a lot of squinting, boiled down to “I do not trust the server you are sending me to.” OIDC clients make back-channel calls to the IdP to exchange codes for tokens and fetch user info, and those calls verify TLS. A self-signed cert on Authentik meant every single integration was broken in a slightly different way, with a slightly different flag to ignore it.
Once Authentik had a real certificate issued from NestCA via Certwarden, and the NestCA root was in the trust store of every client, all of that went away. If you are planning to do SSO at home, do the PKI first. I did it in the wrong order and paid for it.
Things That Bit Me
- Redirect URIs are exact. A trailing slash,
httpvshttps, or the wrong hostname and the login fails with an error that rarely tells you which one it was. - Do not lock yourself out. Keep a break-glass local admin account on Authentik itself and on anything critical like Proxmox. SSO is great right up until the IdP is the thing that is down.
- Logout is harder than login. Logging out of an app does not log you out of Authentik, and vice versa. Set the end-session URL on clients that support it, and accept that some apps simply will not cooperate.
- Groups are the whole game. It is tempting to assign apps to individual users when there are only a few of you. Do groups from the start; it costs nothing and you will want it later.
- Back it up. Authentik is now a dependency for nearly everything. Its database belongs in the backup plan with the same priority as anything else that would ruin a weekend.
Was It Worth It?
Yes, and more than the PKI work, the payoff was immediate. Adding a new service now takes a few minutes in the Authentik UI, MFA happens in one place, and the password manager entry count stopped growing. Taking access away is a group change instead of a memory test.
More importantly, I finally understand what is happening when I click that SSO tile at work. Authorization codes, token endpoints, claims and scopes went from vocabulary I recognized to things I have debugged at 11pm. That is the whole point of the homelab.
Next up, I want to tie Forgejo and Infisical into Authentik as well so the last few holdouts finally get a single front door.
#Authentik #SSO #OIDC #Homelab #Identity