Add NetBox OAuth2/OIDC provider + application #11
Reference in New Issue
Block a user
Delete Branch "benvin/netbox-oidc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
NetBox is being deployed to k8s (argocd-apps PR) with Authentik SSO. NetBox authenticates via python-social-auth's
OpenIdConnectAuthbackend against Authentik.Change
config/providers_oauth2/netbox.yaml: confidential OAuth2 provider + application,client_id: netbox, openid/email/profile scope mappings, strict redirect tohttps://netbox.k8s.syd1.au.unkin.net/oauth/complete/oidc/.client_secretis read from Vault atkv/kubernetes/namespace/netbox/default/oauth-credentials(keyclient_secret). The terraform-authentik runner policy already grantskv/.../namespace/+/default/oauth-credentials, so no terraform-vault change is needed.Manual step (ordered)
The Vault secret must be seeded before apply (the module reads it):
(The
oidc.yamlkey is consumed by NetBox itself; Authentik only readsclient_secret.) The application slug resolves tonetbox, so NetBox'sSOCIAL_AUTH_OIDC_OIDC_ENDPOINT=https://identity.k8s.syd1.au.unkin.net/application/o/netbox/.Merge order
Independent of the argocd-apps PR; SSO only works once both are applied and the secret is seeded. Deploying NetBox without this just means OIDC login is unavailable until applied.
https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
CI
planis red due to a transient Authentik API outage, not this change: the Authentik API returns HTMLServer Error(500) while refreshing existing applications (saml["ceph"],oauth2["litellm"],oauth2["argocd"],oauth2["rancher"]). The NetBox additions resolve cleanly in the same run —data.vault_kv_secret_v2.oauth2["netbox"]: Read complete [id=kv/data/kubernetes/namespace/netbox/default/oauth-credentials]and the netbox flow/scope data sources all read OK. The Vault secret is already seeded. Re-run once the Authentik API recovers.