Microsoft Entra ID
Use Microsoft accounts for authentication with NetBird. This supports both personal Microsoft accounts and Microsoft Entra ID (formerly Azure AD) for work and school accounts.
Connector Setup (Recommended)
Add Microsoft as a connector to the embedded IdP. Choose the appropriate connector type based on your needs:
| Connector Type | Use Case |
|---|---|
Microsoft (microsoft) | Personal Microsoft accounts |
Microsoft Entra ID (entra) | Work/school accounts via Azure AD |
Prerequisites
- NetBird self-hosted with embedded IdP enabled
- Access to Azure Portal or Entra Admin Center
Step 1: Create App Registration
- Navigate to Azure Portal → Azure Active Directory (or Entra Admin Center)
- Click App registrations → New registration
- Fill in:
- Name:
NetBird - Supported account types: Choose based on your needs:
- Personal accounts only:
Personal Microsoft accounts only - Work/school only:
Accounts in this organizational directory only - Both:
Accounts in any organizational directory and personal Microsoft accounts
- Personal accounts only:
- Redirect URI: Leave empty for now
- Name:
- Click Register
- Note the Application (client) ID and Directory (tenant) ID
Step 2: Create Client Secret
- Go to Certificates & secrets
- Click New client secret
- Add a description and expiration
- Click Add
- Copy the Value immediately (it won't be shown again)
Step 3: Add Connector in NetBird
- Log in to your NetBird Dashboard
- Navigate to Settings → Identity Providers
- Click Add Identity Provider
- Fill in the fields:
For Personal Microsoft Accounts:
| Field | Value |
|---|---|
| Type | Microsoft |
| Name | Microsoft (or your preferred display name) |
| Client ID | Application (client) ID from Azure |
| Client Secret | Secret value from Azure |
For Microsoft Entra ID (Work/School):
| Field | Value |
|---|---|
| Type | Microsoft Entra ID |
| Name | Microsoft Work (or your preferred display name) |
| Client ID | Application (client) ID from Azure |
| Client Secret | Secret value from Azure |
| Tenant ID | Directory (tenant) ID from Azure |
- Click Save
Step 4: Configure Redirect URI
After saving, NetBird displays the Redirect URL. Copy this URL and add it to your Azure app:
- Return to Azure Portal → Your app registration
- Go to Authentication
- Click Add a platform → Single-page application
- Add the redirect URL from NetBird
- Click Configure
Step 5: Test the Connection
- Log out of NetBird Dashboard
- On the login page, you should see the Microsoft button
- Click it and sign in with your Microsoft account
- You should be redirected back to NetBird and logged in
Standalone Setup (Advanced)
Use Microsoft Entra ID 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 Microsoft Entra ID 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 Connector Setup (Recommended) section above.
If you prefer to have full control over authentication, consider self-hosted alternatives like Keycloak.
Prerequisites
- An Azure account with appropriate permissions
- Docker and Docker Compose for NetBird
Step 1: Create and Configure Azure AD Application
- Navigate to Azure Active Directory
- Click App Registrations → + New registration
- Fill in:
- Name:
Netbird - Supported account types:
Accounts in this organizational directory only (Single tenant) - Redirect URI: Select
Single-page application (SPA)and enterhttps://<yournetbirddomain.com>/silent-auth
- Name:
- Click Register

Step 2: Configure Platform Settings
- Click Authentication on the left menu
- Under Single-page application, add another URI:
https://<yournetbirddomain.com>/auth

- Scroll down and configure options as shown:

- Click Add a Platform → Mobile and desktop applications
- Add custom redirect URI:
http://localhost:53000 - Click Configure
Step 3: Create Application Scope
- Click Expose an API on the left menu
- Under Application ID URI, click Set then Save
- Click + Add a Scope
- Fill in:
- Scope name:
api
- Scope name:
- Click Add scope

- Under Authorized client applications, click + Add a client application
- Enter your Client ID (same as Application ID URI minus
api://) - Click Add application

Step 4: Add API Permissions
- Click API permissions on the left menu
- Click Add a permission
- Select My APIs tab → Netbird → check
apipermission → Add permissions

- Click Add a permission again
- Select Microsoft Graph → Application permissions
- Search for
User.Readand selectUser.Read.All - Click Add permissions

- Click Grant admin consent for Default Directory → Yes

Step 5: Update Token Version
- Click Manifest on the left menu
- Find
accessTokenAcceptedVersionand change fromnullto2 - Click Save
Step 6: Generate Client Secret
- Click Certificates & secrets on the left menu
- Click New client secret
- Fill in:
- Description:
Netbird
- Description:
- Click Add
- Copy the Value immediately

- Click Overview and note:
- Application (client) ID
- Object ID
- Directory (tenant) ID
Step 7: Configure NetBird
Your authority OIDC configuration will be available at:
https://login.microsoftonline.com/<Directory (tenant) ID>/v2.0/.well-known/openid-configuration
Double-check if the endpoint returns a JSON response by calling it from your browser.
Set properties in the setup.env file:
NETBIRD_DOMAIN="<YOUR_DOMAIN>"
NETBIRD_AUTH_OIDC_CONFIGURATION_ENDPOINT="https://login.microsoftonline.com/<Directory (tenant) ID>/v2.0/.well-known/openid-configuration"
NETBIRD_USE_AUTH0=false
NETBIRD_AUTH_CLIENT_ID="<Application (client) ID>"
NETBIRD_AUTH_SUPPORTED_SCOPES="openid profile email offline_access User.Read api://<Application (client) ID>/api"
NETBIRD_AUTH_AUDIENCE="<Application (client) ID>"
NETBIRD_AUTH_REDIRECT_URI="/auth"
NETBIRD_AUTH_SILENT_REDIRECT_URI="/silent-auth"
NETBIRD_AUTH_USER_ID_CLAIM="oid"
NETBIRD_TOKEN_SOURCE="idToken"
NETBIRD_AUTH_DEVICE_AUTH_PROVIDER="none"
NETBIRD_MGMT_IDP="azure"
NETBIRD_IDP_MGMT_CLIENT_ID="<Application (client) ID>"
NETBIRD_IDP_MGMT_CLIENT_SECRET="<CLIENT_SECRET>"
NETBIRD_IDP_MGMT_EXTRA_OBJECT_ID="<Object ID>"
NETBIRD_IDP_MGMT_EXTRA_GRAPH_API_ENDPOINT="https://graph.microsoft.com/v1.0"
Step 8: Continue with NetBird Setup
You've configured all required resources in Azure AD. Continue with the NetBird Self-hosting Guide.
Troubleshooting
"AADSTS50011: The redirect URI specified in the request does not match"
- Ensure the redirect URI in Azure exactly matches what NetBird provides
- Check platform type (SPA vs Mobile/Desktop)
- Verify no trailing slashes
"AADSTS700016: Application not found"
- Verify the Application (client) ID is correct
- Check tenant ID for single-tenant apps
- Ensure the app registration is in the correct directory
Users from wrong tenant signing in
- Use single-tenant configuration for organization-only access
- Verify "Supported account types" setting in app registration
Token validation errors
- Ensure
accessTokenAcceptedVersionis set to2in the manifest - Verify all scopes are properly configured
- Check that admin consent was granted

