--- # Netbird OIDC Provider Blueprint for Authentik # Creates an OAuth2/OIDC provider for Netbird VPN SSO integration apiVersion: v1 kind: ConfigMap metadata: name: authentik-blueprints-netbird namespace: authentik labels: goauthentik.io/blueprint: "true" data: netbird.yaml: |- version: 1 metadata: name: netbird-oidc entries: - model: authentik_providers_oauth2.oauth2provider id: netbird-provider state: present identifiers: name: Netbird attrs: name: Netbird # NetBird dashboard uses prompt=none for silent auth; this flow avoids consent UI. authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]] authentication_flow: !Find [authentik_flows.flow, [slug, default-authentication-flow]] invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]] redirect_uris: - url: "https://netbird.kube.huskypup.net/.*" matching_mode: regex - url: "http://localhost:53000" matching_mode: strict property_mappings: - !Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]] - !Find [authentik_providers_oauth2.scopemapping, [scope_name, email]] - !Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]] - !Find [authentik_providers_oauth2.scopemapping, [scope_name, offline_access]] - !Find [authentik_providers_oauth2.scopemapping, [scope_name, "goauthentik.io/api"]] client_type: public include_claims_in_id_token: true sub_mode: user_id access_code_validity: "minutes=10" access_token_validity: "hours=1" refresh_token_validity: "days=30" signing_key: !Find [authentik_crypto.certificatekeypair, [name, authentik Self-signed Certificate]] # Create VPN User group (used for non-admin NetBird access) - model: authentik_core.group id: vpn-user-group state: present identifiers: name: VPN User attrs: name: VPN User is_superuser: false - model: authentik_core.application id: netbird-application state: present identifiers: slug: netbird attrs: name: Netbird VPN slug: netbird policy_engine_mode: any provider: !KeyOf netbird-provider # Restrict NetBird access to authentik Admins and VPN User groups - model: authentik_policies.policybinding state: present identifiers: target: !KeyOf netbird-application group: !Find [authentik_core.group, [name, "authentik Admins"]] attrs: target: !KeyOf netbird-application group: !Find [authentik_core.group, [name, "authentik Admins"]] enabled: true order: 0 negate: false timeout: 30 - model: authentik_policies.policybinding state: present identifiers: target: !KeyOf netbird-application group: !Find [authentik_core.group, [name, "VPN User"]] attrs: target: !KeyOf netbird-application group: !Find [authentik_core.group, [name, "VPN User"]] enabled: true order: 1 negate: false timeout: 30