Auth0 SSO with NetBird Self-Hosted
Auth0 is a flexible, drop-in solution to add authentication and authorization services to your applications. It's a managed service that handles identity infrastructure so you don't have to.
Management Setup (Recommended)
Add Auth0 as an external IdP directly in the NetBird Management Dashboard. This is the simplest approach and recommended for most deployments.
Prerequisites
- NetBird self-hosted with embedded IdP enabled
- Auth0 account (sign up at https://auth0.com/)
Step 1: Start Creating Application in Auth0
- Log in to your Auth0 dashboard at https://manage.auth0.com/
- Go to Applications → Applications
- Click Create Application

- Fill in:
- Name:
NetBird - Application type:
Regular Web Application
- Name:

- Click Create
Step 2: Get Redirect URL from NetBird
- Open a new tab or window and log in to your NetBird Dashboard
- Navigate to Settings → Identity Providers
- Click Add Identity Provider
- Fill in the fields:
| Field | Value |
|---|---|
| Type | Generic OIDC |
| Name | Auth0 (or your preferred display name) |
| Client ID | From Auth0 application (will fill after Step 3) |
| Client Secret | From Auth0 application (will fill after Step 3) |
| Issuer | https://your-tenant.auth0.com/ (must include trailing slash) (will fill after Step 3) |
- Copy the Redirect URL that NetBird displays (but don't click Add Provider yet)
Step 3: Complete Auth0 Application Setup
- Return to the Auth0 tab
- Go to Settings tab
- Under Allowed Callback URLs, add the redirect URL you copied from NetBird
- Click Save Changes

- Note the Client ID, Client Secret, and Domain (e.g.,
your-tenant.auth0.com) at the top of the setting tab — you'll need these for Step 4

Step 4: Complete NetBird Setup
- Return to the NetBird tab
- Fill in the Client ID and Client Secret from Step 3
- Update the Issuer field with your Auth0 domain if needed (e.g.,
https://your-tenant.auth0.com/)

- Click Add Provider
Step 5: Test the Connection
- Log out of NetBird Dashboard
- On the login page, you should see an "Auth0" button
- Click it and authenticate
- You should be redirected back to NetBird and logged in. Unless your user approval setting were changed you will need to log back into your local admin account to approve the user.
Standalone Setup (Advanced)
Use Auth0 as your primary identity provider instead of NetBird's embedded IdP. This option gives you full control over authentication and user management, is recommended for experienced Auth0 administrators as it also requires additional setup and ongoing maintenance.
For most deployments, the embedded IdP is the simpler choice — it's built into NetBird, fully integrated, and requires minimal configuration to get started. For this implementation, go back up to the Management Setup (Recommended) section above.
If you prefer to have full control over authentication, consider self-hosted alternatives like Keycloak.
Prerequisites
- Auth0 account (sign up at https://auth0.com/)
- Docker and Docker Compose for NetBird
Configuration Properties
You will configure these properties in setup.env:
NETBIRD_AUTH_CLIENT_IDNETBIRD_AUTH_OIDC_CONFIGURATION_ENDPOINTNETBIRD_USE_AUTH0NETBIRD_AUTH_AUDIENCENETBIRD_AUTH_DEVICE_AUTH_CLIENT_ID(Optional)NETBIRD_MGMT_IDPNETBIRD_IDP_MGMT_CLIENT_IDNETBIRD_IDP_MGMT_CLIENT_SECRETNETBIRD_IDP_MGMT_EXTRA_AUDIENCE
Step 1: Create Dashboard Application
This application authorizes access to NetBird Dashboard.
- Follow the Auth0 React SDK Guide up to "Install the Auth0 React SDK"
- Set Allowed Callback URLs:
https://YOUR_DOMAINandhttp://localhost:53000 - Set Allowed Logout URLs, Allowed Web Origins, Allowed Origins (CORS):
https://YOUR_DOMAINandhttp://localhost
Ensure Token Endpoint Authentication Method is set to None.
- Use Client ID for
NETBIRD_AUTH_CLIENT_ID - Use Domain to configure
NETBIRD_AUTH_OIDC_CONFIGURATION_ENDPOINT:
https://<DOMAIN>/.well-known/openid-configuration
Double-check if the endpoint returns a JSON response by calling it from your browser.
Step 2: Create API
This API is used to access NetBird Management Service.
- Follow the Auth0 Create An API guide
- Use the API Identifier for
NETBIRD_AUTH_AUDIENCE - Set
NETBIRD_USE_AUTH0=true
Step 3: Enable Interactive SSO Login (Optional)
This enables machine authorization via your Identity Provider as an alternative to setup keys.
- Go to Applications
- Click Create Application
- Fill in:
- Name:
Interactive Login - Application type:
Native
- Name:
- Click Create

- Click Settings tab
- Copy Client ID to
NETBIRD_AUTH_DEVICE_AUTH_CLIENT_ID

- Scroll to Advanced Settings
- Enable Device Code
- Click Save Changes

Step 4: Create Machine to Machine Application
This application authorizes access to Auth0 Management API.
- Go to Applications
- Click Create Application
- Fill in:
- Name:
Netbird API - Application type:
Machine to Machine Applications
- Name:
- Click Create

- Configure:
- API:
Auth0 Management API - Permissions:
read:users,update:users,create:users,read:users_app_metadata,update:users_app_metadata,create:users_app_metadata
- API:
- Click Authorize

Optional: To enable automatic user deletion from Auth0 when deleted from NetBird, add the --user-delete-from-idp flag to the management startup command and assign the delete:users permission.
- Click Settings tab
- Copy values:
- Client ID →
NETBIRD_IDP_MGMT_CLIENT_ID - Client Secret →
NETBIRD_IDP_MGMT_CLIENT_SECRET - Domain →
NETBIRD_IDP_MGMT_EXTRA_AUDIENCE(format:https://<DOMAIN>/api/v2/)
- Client ID →

Step 5: Configure NetBird
Set properties in the setup.env file:
NETBIRD_AUTH_OIDC_CONFIGURATION_ENDPOINT="https://<DOMAIN>/.well-known/openid-configuration"
NETBIRD_USE_AUTH0=true
NETBIRD_AUTH_CLIENT_ID="<CLIENT_ID>"
NETBIRD_AUTH_SUPPORTED_SCOPES="openid profile email offline_access api email_verified"
NETBIRD_AUTH_AUDIENCE="<IDENTIFIER>"
NETBIRD_AUTH_DEVICE_AUTH_CLIENT_ID="<INTERACTIVE_CLIENT_ID>"
NETBIRD_MGMT_IDP="auth0"
NETBIRD_IDP_MGMT_CLIENT_ID="<NETBIRD_API_CLIENT_ID>"
NETBIRD_IDP_MGMT_CLIENT_SECRET="<NETBIRD_API_CLIENT_SECRET>"
NETBIRD_IDP_MGMT_EXTRA_AUDIENCE="https://<DOMAIN>/api/v2/"
Step 6: Continue with NetBird Setup
You've configured all required resources in Auth0. Continue with the NetBird Self-hosting Guide.
Troubleshooting
"Invalid redirect URI" error
- Ensure all callback URLs are configured in Auth0
- Check for trailing slashes
- Verify URLs match exactly
"Unauthorized" errors for Management API
- Verify the Machine to Machine application has correct permissions
- Check that
NETBIRD_IDP_MGMT_EXTRA_AUDIENCEincludes/api/v2/
Device authorization not working
- Ensure Device Code grant is enabled in Advanced Settings
- Verify the native application Client ID is used
Token validation errors
- Verify
NETBIRD_USE_AUTH0=trueis set - Check the audience matches the API identifier

