NetBox
Sign in to the NetBox IPAM tool with Pocket ID.
This guide doesn’t currently show how to map groups in NetBox from OIDC claims.
Replace netbox.example.com with the domain of your NetBox instance and id.example.com with the domain of your Pocket ID instance.
Create the client in Pocket ID
Section titled “Create the client in Pocket ID”- In Pocket ID, open Administration → OIDC Clients and click Add OIDC Client.
- Enter a name such as
NetBoxand add the callback URLhttps://netbox.example.com/oauth/complete/oidc/. - Click Create and copy the Client ID and the Client secret. The client secret is only shown once.
- On the client’s Access tab, select the groups that may sign in under Allowed User Groups, or choose All Users.
Configure NetBox
Section titled “Configure NetBox”This guide assumes you use the Git-based installation of NetBox.
-
On your NetBox server, open
/opt/netbox/netbox/netbox. -
Add the following to your
configuration.pyfile, with the Client ID and the Client secret from Pocket ID:# Remote authentication supportREMOTE_AUTH_ENABLED = TrueREMOTE_AUTH_BACKEND = 'social_core.backends.open_id_connect.OpenIdConnectAuth'REMOTE_AUTH_HEADER = 'HTTP_REMOTE_USER'REMOTE_AUTH_USER_FIRST_NAME = 'HTTP_REMOTE_USER_FIRST_NAME'REMOTE_AUTH_USER_LAST_NAME = 'HTTP_REMOTE_USER_LAST_NAME'REMOTE_AUTH_USER_EMAIL = 'HTTP_REMOTE_USER_EMAIL'REMOTE_AUTH_AUTO_CREATE_USER = TrueREMOTE_AUTH_DEFAULT_GROUPS = []REMOTE_AUTH_DEFAULT_PERMISSIONS = {}SOCIAL_AUTH_OIDC_ENDPOINT = 'https://id.example.com'SOCIAL_AUTH_OIDC_KEY = '<client-id>'SOCIAL_AUTH_OIDC_SECRET = '<client-secret>'LOGOUT_REDIRECT_URL = 'https://netbox.example.com' -
Save the file and restart NetBox:
sudo systemctl restart netbox netbox-rq.