{"record":{"id":"4fd0fd61202b654a","repo":"netbirdio/netbird","slug":"unsupported-identity-provider-type","errorCode":null,"errorMessage":"unsupported identity provider type","messagePattern":"unsupported identity provider type","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"management/server/types/identity_provider.go","lineNumber":12,"sourceCode":"package types\n\nimport (\n\t\"errors\"\n\t\"net/url\"\n)\n\n// Identity provider validation errors\nvar (\n\tErrIdentityProviderNameRequired      = errors.New(\"identity provider name is required\")\n\tErrIdentityProviderTypeRequired      = errors.New(\"identity provider type is required\")\n\tErrIdentityProviderTypeUnsupported   = errors.New(\"unsupported identity provider type\")\n\tErrIdentityProviderIssuerRequired    = errors.New(\"identity provider issuer is required\")\n\tErrIdentityProviderIssuerInvalid     = errors.New(\"identity provider issuer must be a valid URL\")\n\tErrIdentityProviderIssuerUnreachable = errors.New(\"identity provider issuer is unreachable\")\n\tErrIdentityProviderIssuerMismatch    = errors.New(\"identity provider issuer does not match the issuer returned by the provider\")\n\tErrIdentityProviderClientIDRequired  = errors.New(\"identity provider client ID is required\")\n)\n\n// IdentityProviderType is the type of identity provider\ntype IdentityProviderType string\n\nconst (\n\t// IdentityProviderTypeOIDC is a generic OIDC identity provider\n\tIdentityProviderTypeOIDC IdentityProviderType = \"oidc\"\n\t// IdentityProviderTypeZitadel is the Zitadel identity provider\n\tIdentityProviderTypeZitadel IdentityProviderType = \"zitadel\"\n\t// IdentityProviderTypeEntra is the Microsoft Entra (Azure AD) identity provider\n\tIdentityProviderTypeEntra IdentityProviderType = \"entra\"\n\t// IdentityProviderTypeGoogle is the Google identity provider","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/management/server/types/identity_provider.go#L1-L30","documentation":"Sentinel error types.ErrIdentityProviderTypeUnsupported (management/server/types/identity_provider.go:12), returned by IdentityProvider.Validate when Type.IsValid() is false. The valid set is fixed in code: oidc, zitadel, entra, google, okta, pocketid, microsoft, authentik, keycloak, adfs. Anything else, including legacy or misspelled values, is rejected.","triggerScenarios":"Saving an IdP config whose type is not in the switch in IdentityProviderType.IsValid, e.g. \"azure\", \"oauth2\", \"OIDC\" (capitalized), or a type added in a newer management version than the one you run.","commonSituations":"Upgrading or downgrading management versions where the supported type list changed; using generic \"oidc-like\" names instead of exact constants; automation written against different NetBird distributions.","solutions":["Use an exact supported constant, most commonly types.IdentityProviderTypeOIDC (\"oidc\") for generic OIDC providers","If you expect a newer type (e.g. entra), upgrade the management service to a version that lists it in IsValid()"],"exampleFix":"// before\nidp.Type = \"azure\"\n\n// after\nidp.Type = types.IdentityProviderTypeEntra // \"entra\"","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func isSupportedIdPType(t string) bool {\n    switch types.IdentityProviderType(t) {\n    case types.IdentityProviderTypeOIDC, types.IdentityProviderTypeZitadel,\n        types.IdentityProviderTypeEntra, types.IdentityProviderTypeGoogle,\n        types.IdentityProviderTypeOkta, types.IdentityProviderTypePocketID,\n        types.IdentityProviderTypeMicrosoft, types.IdentityProviderTypeAuthentik,\n        types.IdentityProviderTypeKeycloak, types.IdentityProviderTypeADFS:\n        return true\n    }\n    return false\n}","tryCatchPattern":"if err := idp.Validate(); err != nil {\n    if errors.Is(err, types.ErrIdentityProviderTypeUnsupported) {\n        // map to the closest supported type (e.g. \"azure\"->entra) or fail with guidance\n    }\n    return err\n}","preventionTips":["Reference the constants in types/identity_provider.go instead of string literals in config","Check IdentityProviderType.IsValid() client-side before submitting","After management upgrades, review the supported-type list if you use newly added providers"],"tags":["management","identity-provider","oidc","validation","version-compat"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}