mirror of
https://github.com/swissmakers/netbox-plus.git
synced 2026-05-08 23:38:57 +02:00
2.5 KiB
2.5 KiB
Enterprise authentication (NetBox Plus)
LDAP and OIDC settings in NetBox Plus are primarily managed in Admin → Authentication → LDAP / OIDC. Changes saved there are persisted in the database (ENTERPRISE_AUTH in ConfigRevision) and hot-applied without restarting workers.
Precedence
- Environment overrides —>
NETBOX_LDAP_BIND_PASSWORD,NETBOX_OIDC_SECRET, andNETBOX_OIDC_KEYoverride secret values at runtime. Corresponding UI fields are read-only while those environment variables are set. ENTERPRISE_AUTHdynamic config (database) —> Primary persistent source, edited in Admin UI.netbox/ldap_config.py(legacy fallback) —> If this module exists and definesAUTH_LDAP_SERVER_URI, LDAP is loaded from that file for compatibility with legacy deployments.
OpenID Connect
- Enable
oidc.enabled, setoidc_endpoint(issuer base URL without/.well-known/openid-configuration),key, andsecret(or use the environment variables above). - When both LDAP and OIDC are enabled in
ENTERPRISE_AUTH,netbox.authentication.LDAPBackendis registered beforesocial_core.backends.open_id_connect.OpenIdConnectAuthso username/password login tries LDAP first; OIDC remains the SSO button flow on the login page. Either backend is omitted when itsenabledflag is false, unless already present fromREMOTE_AUTH_BACKENDinconfiguration.py. django.conf.settingsis updated per request so changes take effect without restarting the WSGI workers.
LDAP
- Install system LDAP libraries and
django-auth-ldap(included in NetBox Plusrequirements.txt). - Set
REMOTE_AUTH_BACKENDinconfiguration.pyto includenetbox.authentication.LDAPBackend(and typicallydjango.contrib.auth.backends.ModelBackendfor local users), or enableldap.enabledinENTERPRISE_AUTH; the middleware will injectLDAPBackendwhen it is missing from the static backend list. - When using only dynamic config (no
ldap_config.py), fillserver_uri,user_search_base,user_search_filter, and other fields as described in the LDAP installation guide (the same concepts apply).
Demo templates (Active Directory / FreeIPA)
On Admin → Authentication → LDAP / OIDC, open Configure LDAP, then use Active Directory or FreeIPA to load placeholders into the form (save to apply). Replace all example.com / dc=example,dc=com values with your directory. Do not use the demo bind passwords in production; prefer NETBOX_LDAP_BIND_PASSWORD.