[GH-ISSUE #5108] NetBird not working with Traefik + Keycloak setup #9912

Closed
opened 2026-08-05 01:23:56 -04:00 by saavagebueno · 3 comments
Owner

Originally created by @iForged on GitHub (Jan 15, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5108

NetBird not working with Traefik + Keycloak setup

I tried to integrate NetBird with Traefik and Keycloak, since I already use these services in my environment. I used the provided docker-compose.yml.tmpl.traefik and the example setup.env from NetBird.

docker-compose.yml
x-default: &default
  restart: 'unless-stopped'
  logging:
    driver: 'json-file'
    options:
      max-size: '500m'
      max-file: '2'

services:
  # UI dashboard
  dashboard:
    <<: *default
    image: netbirdio/dashboard:latest
    environment:
      # Endpoints
      - NETBIRD_MGMT_API_ENDPOINT=https://netbird.mydomain.tld:33073
      - NETBIRD_MGMT_GRPC_API_ENDPOINT=https://netbird.mydomain.tld:33073
      # OIDC
      - AUTH_AUDIENCE=Netbird
      - AUTH_CLIENT_ID=Netbird
      - AUTH_CLIENT_SECRET=zNW59ZOEU...
      - AUTH_AUTHORITY=https://sso.mydomain.tld/realms/MyRealm
      - USE_AUTH0=false
      - AUTH_SUPPORTED_SCOPES=openid profile email
      - AUTH_REDIRECT_URI=
      - AUTH_SILENT_REDIRECT_URI=
      - NETBIRD_TOKEN_SOURCE=accessToken
      # SSL
      - NGINX_SSL_PORT=443
      # Letsencrypt
      - LETSENCRYPT_DOMAIN=
      - LETSENCRYPT_EMAIL=
    networks:
      - proxy
    volumes:
      - ./data/ssl:/etc/letsencrypt/
    labels:
      - traefik.enable=true
      - traefik.http.routers.netbird-dashboard.rule=Host(`netbird.mydomain.tld``)
      - traefik.http.services.netbird-dashboard.loadbalancer.server.port=80
      - traefik.http.routers.netbird-dashboard.tls=true

  # Signal
  signal:
    <<: *default
    image: netbirdio/signal:latest
    networks:
      - proxy
    volumes:
      - ./data/signal:/var/lib/netbird
    labels:
      - traefik.enable=true
      - traefik.http.routers.netbird-wsproxy-signal.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/ws-proxy/signal`)
      - traefik.http.routers.netbird-wsproxy-signal.service=netbird-wsproxy-signal
      - traefik.http.services.netbird-wsproxy-signal.loadbalancer.server.port=80
      - traefik.http.routers.netbird-wsproxy-signal.tls=true
      - traefik.http.routers.netbird-signal.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/signalexchange.SignalExchange/`)
      - traefik.http.routers.netbird-signal.service=netbird-signal
      - traefik.http.services.netbird-signal.loadbalancer.server.port=10000
      - traefik.http.services.netbird-signal.loadbalancer.server.scheme=h2c
      - traefik.http.routers.netbird-signal.tls=true

  # Relay
  relay:
    <<: *default
    image: netbirdio/relay:latest
    environment:
      - NB_LOG_LEVEL=info
      - NB_LISTEN_ADDRESS=:33080
      - NB_EXPOSED_ADDRESS=rels://netbird.mydomain.tld:33080/relay
      # todo: change to a secure secret
      - NB_AUTH_SECRET=2De2izdt...
    networks:
      - proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.netbird-relay.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/relay`)
      - traefik.http.services.netbird-relay.loadbalancer.server.port=33080
      - traefik.http.routers.netbird-relay.tls=true

  # Management
  management:
    <<: *default
    image: netbirdio/management:latest
    depends_on:
      - dashboard
    environment:
      - NETBIRD_STORE_ENGINE_POSTGRES_DSN=
      - NETBIRD_STORE_ENGINE_MYSQL_DSN=
    volumes:
      - ./data/mgmt:/var/lib/netbird
      - ./data/ssl:/etc/letsencrypt:ro
      - ./management.json:/etc/netbird/management.json
    command: [
      "--port", "33073",
      "--log-file", "console",
      "--log-level", "info",
      "--disable-anonymous-metrics=false",
      "--single-account-mode-domain=netbird.mydomain.tld`",
      "--dns-domain=netbird.selfhosted"
      ]
    networks:
      - proxy
    labels:
      - traefik.enable=true
      - traefik.http.routers.netbird-api.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/api`)
      - traefik.http.routers.netbird-api.service=netbird-api
      - traefik.http.services.netbird-api.loadbalancer.server.port=33073
      - traefik.http.routers.netbird-api.tls=true
      - traefik.http.routers.netbird-wsproxy-mgmt.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/ws-proxy/management`)
      - traefik.http.routers.netbird-wsproxy-mgmt.service=netbird-wsproxy-mgmt
      - traefik.http.services.netbird-wsproxy-mgmt.loadbalancer.server.port=33073
      - traefik.http.routers.netbird-wsproxy-mgmt.tls=true
      - traefik.http.routers.netbird-management.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/management.ManagementService/`)
      - traefik.http.routers.netbird-management.service=netbird-management
      - traefik.http.services.netbird-management.loadbalancer.server.port=33073
      - traefik.http.services.netbird-management.loadbalancer.server.scheme=h2c
      - traefik.http.routers.netbird-management.tls=true

  # Coturn
  coturn:
    <<: *default
    image: coturn/coturn:latest
    domainname: netbird.mydomain.tld
    volumes:
      - ./turnserver.conf:/etc/turnserver.conf:ro
    network_mode: host
    command:
      - -c /etc/turnserver.conf

networks:
  proxy:
    external: true

management.json
{
    "Stuns": [
        {
            "Proto": "udp",
            "URI": "stun:netbird.mydomain.tld:3478",
            "Username": "",
            "Password": ""
        }
    ],```
    "TURNConfig": {
        "TimeBasedCredentials": false,
        "CredentialsTTL": "12h0m0s",
        "Secret": "secret",
        "Turns": [
            {
                "Proto": "udp",
                "URI": "turn:netbird.mydomain.tld:3478",
                "Username": "self",
                "Password": "t17SuUkC..."
            }
        ]
    },
    "Relay": {
        "Addresses": [
            "rels://netbird.mydomain.tld:33080/relay"
        ],
        "CredentialsTTL": "24h0m0s",
        "Secret": "2De2izdt...."
    },
    "Signal": {
        "Proto": "http",
        "URI": "netbird.mydomain.tld:10000",
        "Username": "",
        "Password": ""
    },
    "Datadir": "/var/lib/netbird/",
    "DataStoreEncryptionKey": "bTgFeGkw....",
    "HttpConfig": {
        "LetsEncryptDomain": "",
        "CertFile": "",
        "CertKey": "",
        "AuthAudience": "Netbird",
        "CLIAuthAudience": "",
        "AuthIssuer": "https://sso.mydomain.tld/realms/MyRealm",
        "AuthUserIDClaim": "",
        "AuthKeysLocation": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/certs",
        "OIDCConfigEndpoint": "https://sso.mydomain.tld/realms/MyRealm/.well-known/openid-configuration",
        "IdpSignKeyRefreshEnabled": false,
        "ExtraAuthAudience": ""
    },
    "IdpManagerConfig": {
        "ManagerType": "keycloak",
        "ClientConfig": {
            "Issuer": "https://sso.mydomain.tld/realms/MyRealm",
            "TokenEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token",
            "ClientID": "Netbird",
            "ClientSecret": "zNW59ZOE...",
            "GrantType": "client_credentials"
        },
        "ExtraConfig": {
            "AdminEndpoint": "https://sso.mydomain.tld/admin/realms/MyRealm"
        },
        "Auth0ClientCredentials": null,
        "AzureClientCredentials": null,
        "KeycloakClientCredentials": null,
        "ZitadelClientCredentials": null
    },
    "DeviceAuthorizationFlow": {
        "Provider": "none",
        "ProviderConfig": {
            "ClientID": "",
            "ClientSecret": "",
            "Domain": "",
            "Audience": "netbird-api",
            "TokenEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token",
            "DeviceAuthEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth/device",
            "AuthorizationEndpoint": "",
            "Scope": "openid",
            "UseIDToken": false,
            "RedirectURLs": null,
            "DisablePromptLogin": false,
            "LoginFlag": 0
        }
    },
    "PKCEAuthorizationFlow": {
        "ProviderConfig": {
            "ClientID": "Netbird",
            "ClientSecret": "zNW59ZOEU...",
            "Domain": "",
            "Audience": "netbird-api",
            "TokenEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token",
            "DeviceAuthEndpoint": "",
            "AuthorizationEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth",
            "Scope": "openid profile email",
            "UseIDToken": false,
            "RedirectURLs": [
                "http://localhost:53000"
            ],
            "DisablePromptLogin": false,
            "LoginFlag": 0
        }
    },
    "StoreConfig": {
        "Engine": "sqlite"
    },
    "ReverseProxy": {
        "TrustedHTTPProxies": [],
        "TrustedHTTPProxiesCount": 0,
        "TrustedPeers": [
            "0.0.0.0/0"
        ]
    },
    "DisableDefaultPolicy": false,
    "EmbeddedIdP": null
}
Keycloak client

General settings

Client ID: Netbird
Name: Netbird
Description: 
Always display in UI: Off

Access settings

Root URL: 
Home URL: 
Valid redirect URIs: https://netbird.mydomain.tld/*
Valid post logout redirect URIs: 
Web origins:
Admin URL:

Capability config

Client authentication: On
Authorization: Off
Authentication flow:
- Standard flow: true
- Direct access grants: false
- Implicit flow: false
- Service accounts roles: false
- OAuth 2.0 Device Authorization Grant:false
- OIDC CIBA Grant: false
MGMT Logs
2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:238: loading OIDC configuration from the provided IDP configuration endpoint https://sso.mydomain.tld/realms/MyRealm/.well-known/openid-configuration
2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:243: loaded OIDC configuration from the provided IDP configuration endpoint: https://sso.mydomain.tld/realms/MyRealm/.well-known/openid-configuration
2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:245: overriding HttpConfig.AuthIssuer with a new value https://sso.mydomain.tld/realms/MyRealm, previously configured value: https://sso.mydomain.tld/realms/MyRealm
2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:249: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/certs, previously configured value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/certs
2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:294: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token, previously configured value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token
2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:298: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth, previously configured value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth
2026-01-15T12:32:46Z INFO management/cmd/management.go:309: Relay addresses: [rels://netbird.mydomain.tld:33080/relay]
2026-01-15T12:32:46Z INFO management/server/store/store.go:275: using SQLite store engine
2026-01-15T12:32:46Z INFO management/server/store/sql_store.go:96: Setting transaction timeout to 5m0s
2026-01-15T12:32:46Z INFO management/server/store/sql_store.go:110: Set max open db connections to 1, max idle to 1, max lifetime to 1h0m0s, max idle time to 3m0s
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:148: No records in table peers, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:148: No records in table peers, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:263: No plain setup keys found in table setup_keys, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:301: Migration of plain setup key to hashed setup key completed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty enabled found in table network_resources, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty enabled to default value in table network_resources completed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty enabled found in table network_routers, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty enabled to default value in table network_routers completed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty name found in table users, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty name to default value in table users completed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty email found in table users, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty email to default value in table users completed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:399: index idx_account_ip already exists on table peers
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:399: index idx_account_dnslabel already exists on table peers
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:399: index idx_peers_key_unique already exists on table peers
2026-01-15T12:32:46Z INFO management/internals/server/modules.go:41: geolocation service has been initialized from /var/lib/netbird/
2026-01-15T12:32:46Z INFO management/server/telemetry/app_metrics.go:193: enabled application metrics and exposing on http://0.0.0.0:9090
2026-01-15T12:32:46Z INFO management/server/account_request_buffer.go:45: set account request buffer interval to 100ms
2026-01-15T12:32:46Z INFO management/server/activity/store/sql_store.go:261: using sqlite as activity event store engine
2026-01-15T12:32:46Z INFO management/server/activity/store/sql_store.go:290: Set max open db connections to 1, max idle to 1, max lifetime to 1h0m0s, max idle time to 3m0s
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty name found in table deleted_users, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty name to default value in table deleted_users completed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty enc_algo found in table deleted_users, no migration needed
2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty enc_algo to default value in table deleted_users completed
2026-01-15T12:32:46Z WARN management/internals/controllers/network_map/controller/controller.go:83: failed to parse NB_EXPERIMENT_NETWORK_MAP, using default value false: strconv.ParseBool: parsing "": invalid syntax
2026-01-15T12:32:46Z INFO management/server/account_request_buffer.go:45: set account request buffer interval to 100ms
2026-01-15T12:32:46Z WARN management/internals/controllers/network_map/controller/controller.go:605: failed to parse peer update interval, using default value 1ms: strconv.Atoi: parsing "": invalid syntax
2026-01-15T12:32:46Z INFO management/internals/controllers/network_map/controller/controller.go:621: set peer update buffer interval to 1ms
2026-01-15T12:32:46Z INFO management/server/account.go:234: single account mode enabled, accounts number 0
2026-01-15T12:32:46Z INFO management/internals/server/server.go:187: management server version 0.62.3
2026-01-15T12:32:46Z INFO management/internals/server/server.go:188: running HTTP server and gRPC server on the same port: [::]:33073
2026-01-15T12:32:46Z INFO management/server/account.go:605: 1 entries received from IdP management
2026-01-15T12:32:46Z INFO management/server/account.go:636: warmed up IDP cache with 0 entries for 0 accounts
2026-01-15T12:32:48Z ERRO [context: GRPC, requestID: d5kdss3ktfk9g1m7809g] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key
2026-01-15T12:32:49Z ERRO [context: GRPC, requestID: d5kdssbktfk9g1m780ag] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key
2026-01-15T12:32:49Z ERRO [context: GRPC, requestID: d5kdssbktfk9g1m780bg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key
2026-01-15T12:32:50Z ERRO [context: GRPC, requestID: d5kdssjktfk9g1m780cg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key
2026-01-15T12:32:51Z ERRO [requestID: d5kdssrktfk9g1m780dg, context: GRPC] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key
2026-01-15T12:32:51Z ERRO [context: GRPC, requestID: d5kdssrktfk9g1m780eg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key
2026-01-15T12:32:52Z ERRO [context: GRPC, requestID: d5kdst3ktfk9g1m780fg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key
Originally created by @iForged on GitHub (Jan 15, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5108 NetBird not working with Traefik + Keycloak setup I tried to integrate NetBird with Traefik and Keycloak, since I already use these services in my environment. I used the provided `docker-compose.yml.tmpl.traefik` and the example `setup.env` from NetBird. <details><summary>docker-compose.yml</summary> ``` x-default: &default restart: 'unless-stopped' logging: driver: 'json-file' options: max-size: '500m' max-file: '2' services: # UI dashboard dashboard: <<: *default image: netbirdio/dashboard:latest environment: # Endpoints - NETBIRD_MGMT_API_ENDPOINT=https://netbird.mydomain.tld:33073 - NETBIRD_MGMT_GRPC_API_ENDPOINT=https://netbird.mydomain.tld:33073 # OIDC - AUTH_AUDIENCE=Netbird - AUTH_CLIENT_ID=Netbird - AUTH_CLIENT_SECRET=zNW59ZOEU... - AUTH_AUTHORITY=https://sso.mydomain.tld/realms/MyRealm - USE_AUTH0=false - AUTH_SUPPORTED_SCOPES=openid profile email - AUTH_REDIRECT_URI= - AUTH_SILENT_REDIRECT_URI= - NETBIRD_TOKEN_SOURCE=accessToken # SSL - NGINX_SSL_PORT=443 # Letsencrypt - LETSENCRYPT_DOMAIN= - LETSENCRYPT_EMAIL= networks: - proxy volumes: - ./data/ssl:/etc/letsencrypt/ labels: - traefik.enable=true - traefik.http.routers.netbird-dashboard.rule=Host(`netbird.mydomain.tld``) - traefik.http.services.netbird-dashboard.loadbalancer.server.port=80 - traefik.http.routers.netbird-dashboard.tls=true # Signal signal: <<: *default image: netbirdio/signal:latest networks: - proxy volumes: - ./data/signal:/var/lib/netbird labels: - traefik.enable=true - traefik.http.routers.netbird-wsproxy-signal.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/ws-proxy/signal`) - traefik.http.routers.netbird-wsproxy-signal.service=netbird-wsproxy-signal - traefik.http.services.netbird-wsproxy-signal.loadbalancer.server.port=80 - traefik.http.routers.netbird-wsproxy-signal.tls=true - traefik.http.routers.netbird-signal.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/signalexchange.SignalExchange/`) - traefik.http.routers.netbird-signal.service=netbird-signal - traefik.http.services.netbird-signal.loadbalancer.server.port=10000 - traefik.http.services.netbird-signal.loadbalancer.server.scheme=h2c - traefik.http.routers.netbird-signal.tls=true # Relay relay: <<: *default image: netbirdio/relay:latest environment: - NB_LOG_LEVEL=info - NB_LISTEN_ADDRESS=:33080 - NB_EXPOSED_ADDRESS=rels://netbird.mydomain.tld:33080/relay # todo: change to a secure secret - NB_AUTH_SECRET=2De2izdt... networks: - proxy labels: - traefik.enable=true - traefik.http.routers.netbird-relay.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/relay`) - traefik.http.services.netbird-relay.loadbalancer.server.port=33080 - traefik.http.routers.netbird-relay.tls=true # Management management: <<: *default image: netbirdio/management:latest depends_on: - dashboard environment: - NETBIRD_STORE_ENGINE_POSTGRES_DSN= - NETBIRD_STORE_ENGINE_MYSQL_DSN= volumes: - ./data/mgmt:/var/lib/netbird - ./data/ssl:/etc/letsencrypt:ro - ./management.json:/etc/netbird/management.json command: [ "--port", "33073", "--log-file", "console", "--log-level", "info", "--disable-anonymous-metrics=false", "--single-account-mode-domain=netbird.mydomain.tld`", "--dns-domain=netbird.selfhosted" ] networks: - proxy labels: - traefik.enable=true - traefik.http.routers.netbird-api.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/api`) - traefik.http.routers.netbird-api.service=netbird-api - traefik.http.services.netbird-api.loadbalancer.server.port=33073 - traefik.http.routers.netbird-api.tls=true - traefik.http.routers.netbird-wsproxy-mgmt.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/ws-proxy/management`) - traefik.http.routers.netbird-wsproxy-mgmt.service=netbird-wsproxy-mgmt - traefik.http.services.netbird-wsproxy-mgmt.loadbalancer.server.port=33073 - traefik.http.routers.netbird-wsproxy-mgmt.tls=true - traefik.http.routers.netbird-management.rule=Host(`netbird.mydomain.tld`) && PathPrefix(`/management.ManagementService/`) - traefik.http.routers.netbird-management.service=netbird-management - traefik.http.services.netbird-management.loadbalancer.server.port=33073 - traefik.http.services.netbird-management.loadbalancer.server.scheme=h2c - traefik.http.routers.netbird-management.tls=true # Coturn coturn: <<: *default image: coturn/coturn:latest domainname: netbird.mydomain.tld volumes: - ./turnserver.conf:/etc/turnserver.conf:ro network_mode: host command: - -c /etc/turnserver.conf networks: proxy: external: true ``` </details> <details><summary>management.json</summary> ``` { "Stuns": [ { "Proto": "udp", "URI": "stun:netbird.mydomain.tld:3478", "Username": "", "Password": "" } ],``` "TURNConfig": { "TimeBasedCredentials": false, "CredentialsTTL": "12h0m0s", "Secret": "secret", "Turns": [ { "Proto": "udp", "URI": "turn:netbird.mydomain.tld:3478", "Username": "self", "Password": "t17SuUkC..." } ] }, "Relay": { "Addresses": [ "rels://netbird.mydomain.tld:33080/relay" ], "CredentialsTTL": "24h0m0s", "Secret": "2De2izdt...." }, "Signal": { "Proto": "http", "URI": "netbird.mydomain.tld:10000", "Username": "", "Password": "" }, "Datadir": "/var/lib/netbird/", "DataStoreEncryptionKey": "bTgFeGkw....", "HttpConfig": { "LetsEncryptDomain": "", "CertFile": "", "CertKey": "", "AuthAudience": "Netbird", "CLIAuthAudience": "", "AuthIssuer": "https://sso.mydomain.tld/realms/MyRealm", "AuthUserIDClaim": "", "AuthKeysLocation": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/certs", "OIDCConfigEndpoint": "https://sso.mydomain.tld/realms/MyRealm/.well-known/openid-configuration", "IdpSignKeyRefreshEnabled": false, "ExtraAuthAudience": "" }, "IdpManagerConfig": { "ManagerType": "keycloak", "ClientConfig": { "Issuer": "https://sso.mydomain.tld/realms/MyRealm", "TokenEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token", "ClientID": "Netbird", "ClientSecret": "zNW59ZOE...", "GrantType": "client_credentials" }, "ExtraConfig": { "AdminEndpoint": "https://sso.mydomain.tld/admin/realms/MyRealm" }, "Auth0ClientCredentials": null, "AzureClientCredentials": null, "KeycloakClientCredentials": null, "ZitadelClientCredentials": null }, "DeviceAuthorizationFlow": { "Provider": "none", "ProviderConfig": { "ClientID": "", "ClientSecret": "", "Domain": "", "Audience": "netbird-api", "TokenEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token", "DeviceAuthEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth/device", "AuthorizationEndpoint": "", "Scope": "openid", "UseIDToken": false, "RedirectURLs": null, "DisablePromptLogin": false, "LoginFlag": 0 } }, "PKCEAuthorizationFlow": { "ProviderConfig": { "ClientID": "Netbird", "ClientSecret": "zNW59ZOEU...", "Domain": "", "Audience": "netbird-api", "TokenEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token", "DeviceAuthEndpoint": "", "AuthorizationEndpoint": "https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth", "Scope": "openid profile email", "UseIDToken": false, "RedirectURLs": [ "http://localhost:53000" ], "DisablePromptLogin": false, "LoginFlag": 0 } }, "StoreConfig": { "Engine": "sqlite" }, "ReverseProxy": { "TrustedHTTPProxies": [], "TrustedHTTPProxiesCount": 0, "TrustedPeers": [ "0.0.0.0/0" ] }, "DisableDefaultPolicy": false, "EmbeddedIdP": null } ``` </details> <details><summary>Keycloak client</summary> **General settings** ``` Client ID: Netbird Name: Netbird Description: Always display in UI: Off ``` **Access settings** ``` Root URL: Home URL: Valid redirect URIs: https://netbird.mydomain.tld/* Valid post logout redirect URIs: Web origins: Admin URL: ``` **Capability config** ``` Client authentication: On Authorization: Off Authentication flow: - Standard flow: true - Direct access grants: false - Implicit flow: false - Service accounts roles: false - OAuth 2.0 Device Authorization Grant:false - OIDC CIBA Grant: false ``` </details> <details><summary>MGMT Logs</summary> ``` 2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:238: loading OIDC configuration from the provided IDP configuration endpoint https://sso.mydomain.tld/realms/MyRealm/.well-known/openid-configuration 2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:243: loaded OIDC configuration from the provided IDP configuration endpoint: https://sso.mydomain.tld/realms/MyRealm/.well-known/openid-configuration 2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:245: overriding HttpConfig.AuthIssuer with a new value https://sso.mydomain.tld/realms/MyRealm, previously configured value: https://sso.mydomain.tld/realms/MyRealm 2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:249: overriding HttpConfig.AuthKeysLocation (JWT certs) with a new value https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/certs, previously configured value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/certs 2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:294: overriding PKCEAuthorizationFlow.TokenEndpoint with a new value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token, previously configured value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/token 2026-01-15T12:32:46Z INFO [context: SYSTEM] management/cmd/management.go:298: overriding PKCEAuthorizationFlow.AuthorizationEndpoint with a new value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth, previously configured value: https://sso.mydomain.tld/realms/MyRealm/protocol/openid-connect/auth 2026-01-15T12:32:46Z INFO management/cmd/management.go:309: Relay addresses: [rels://netbird.mydomain.tld:33080/relay] 2026-01-15T12:32:46Z INFO management/server/store/store.go:275: using SQLite store engine 2026-01-15T12:32:46Z INFO management/server/store/sql_store.go:96: Setting transaction timeout to 5m0s 2026-01-15T12:32:46Z INFO management/server/store/sql_store.go:110: Set max open db connections to 1, max idle to 1, max lifetime to 1h0m0s, max idle time to 3m0s 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:148: No records in table peers, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:148: No records in table peers, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:263: No plain setup keys found in table setup_keys, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:301: Migration of plain setup key to hashed setup key completed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty enabled found in table network_resources, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty enabled to default value in table network_resources completed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty enabled found in table network_routers, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty enabled to default value in table network_routers completed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty name found in table users, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty name to default value in table users completed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty email found in table users, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty email to default value in table users completed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:399: index idx_account_ip already exists on table peers 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:399: index idx_account_dnslabel already exists on table peers 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:399: index idx_peers_key_unique already exists on table peers 2026-01-15T12:32:46Z INFO management/internals/server/modules.go:41: geolocation service has been initialized from /var/lib/netbird/ 2026-01-15T12:32:46Z INFO management/server/telemetry/app_metrics.go:193: enabled application metrics and exposing on http://0.0.0.0:9090 2026-01-15T12:32:46Z INFO management/server/account_request_buffer.go:45: set account request buffer interval to 100ms 2026-01-15T12:32:46Z INFO management/server/activity/store/sql_store.go:261: using sqlite as activity event store engine 2026-01-15T12:32:46Z INFO management/server/activity/store/sql_store.go:290: Set max open db connections to 1, max idle to 1, max lifetime to 1h0m0s, max idle time to 3m0s 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty name found in table deleted_users, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty name to default value in table deleted_users completed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:344: No rows with empty enc_algo found in table deleted_users, no migration needed 2026-01-15T12:32:46Z INFO management/server/migration/migration.go:358: Migration of empty enc_algo to default value in table deleted_users completed 2026-01-15T12:32:46Z WARN management/internals/controllers/network_map/controller/controller.go:83: failed to parse NB_EXPERIMENT_NETWORK_MAP, using default value false: strconv.ParseBool: parsing "": invalid syntax 2026-01-15T12:32:46Z INFO management/server/account_request_buffer.go:45: set account request buffer interval to 100ms 2026-01-15T12:32:46Z WARN management/internals/controllers/network_map/controller/controller.go:605: failed to parse peer update interval, using default value 1ms: strconv.Atoi: parsing "": invalid syntax 2026-01-15T12:32:46Z INFO management/internals/controllers/network_map/controller/controller.go:621: set peer update buffer interval to 1ms 2026-01-15T12:32:46Z INFO management/server/account.go:234: single account mode enabled, accounts number 0 2026-01-15T12:32:46Z INFO management/internals/server/server.go:187: management server version 0.62.3 2026-01-15T12:32:46Z INFO management/internals/server/server.go:188: running HTTP server and gRPC server on the same port: [::]:33073 2026-01-15T12:32:46Z INFO management/server/account.go:605: 1 entries received from IdP management 2026-01-15T12:32:46Z INFO management/server/account.go:636: warmed up IDP cache with 0 entries for 0 accounts 2026-01-15T12:32:48Z ERRO [context: GRPC, requestID: d5kdss3ktfk9g1m7809g] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key 2026-01-15T12:32:49Z ERRO [context: GRPC, requestID: d5kdssbktfk9g1m780ag] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key 2026-01-15T12:32:49Z ERRO [context: GRPC, requestID: d5kdssbktfk9g1m780bg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key 2026-01-15T12:32:50Z ERRO [context: GRPC, requestID: d5kdssjktfk9g1m780cg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key 2026-01-15T12:32:51Z ERRO [requestID: d5kdssrktfk9g1m780dg, context: GRPC] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key 2026-01-15T12:32:51Z ERRO [context: GRPC, requestID: d5kdssrktfk9g1m780eg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key 2026-01-15T12:32:52Z ERRO [context: GRPC, requestID: d5kdst3ktfk9g1m780fg] management/internals/shared/grpc/server.go:437: got an unhandled error: failed to get user ID by peer key ``` </details>
saavagebueno added the triage-needed label 2026-08-05 01:23:56 -04:00
Author
Owner

@iForged commented on GitHub (Jan 16, 2026):

This is what authorization via Keycloak looks like in the browser. When opening the local NetBird site in the browser, it redirects to the Keycloak login form, and after successful authorization it returns to the page shown in the screenshot.

Screenshot Image
<!-- gh-comment-id:3758900432 --> @iForged commented on GitHub (Jan 16, 2026): This is what authorization via Keycloak looks like in the browser. When opening the local NetBird site in the browser, it redirects to the Keycloak login form, and after successful authorization it returns to the page shown in the screenshot. <details><summary>Screenshot</summary> <img width="1919" height="952" alt="Image" src="https://github.com/user-attachments/assets/b6d76377-211f-415b-8959-27c2349efd34" /> </details>
Author
Owner

@iForged commented on GitHub (Jan 16, 2026):

I also launched an already prepared Traefik + Zitadel build to try accessing it and adding Keycloak as a provider in the dashboard settings, following the guide https://docs.netbird.io/selfhosted/identity-providers/keycloak.
However, there is no IdP setting in the NetBird settings.

Screenshot Image
<!-- gh-comment-id:3759888926 --> @iForged commented on GitHub (Jan 16, 2026): I also launched an already prepared Traefik + Zitadel build to try accessing it and adding Keycloak as a provider in the dashboard settings, following the guide https://docs.netbird.io/selfhosted/identity-providers/keycloak. However, there is no IdP setting in the NetBird settings. <details><summary>Screenshot</summary> <img width="1920" height="777" alt="Image" src="https://github.com/user-attachments/assets/2cf973c7-f965-45f2-86d2-4c3fae1df5f2" /> </details>
Author
Owner

@iForged commented on GitHub (Feb 9, 2026):

The problem is solved. I might not be the only one who has encountered this, so I plan to share my configuration in the future.

<!-- gh-comment-id:3872613626 --> @iForged commented on GitHub (Feb 9, 2026): The problem is solved. I might not be the only one who has encountered this, so I plan to share my configuration in the future.
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9912