{"record":{"id":"65ce2803eb58813e","repo":"netbirdio/netbird","slug":"identity-provider-type-is-required","errorCode":null,"errorMessage":"identity provider type is required","messagePattern":"identity provider type is required","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"management/server/types/identity_provider.go","lineNumber":11,"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\"","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/management/server/types/identity_provider.go#L1-L29","documentation":"Sentinel error types.ErrIdentityProviderTypeRequired (management/server/types/identity_provider.go:11), returned by IdentityProvider.Validate when Type is the empty string. NetBird needs the type to dispatch to the correct IdP driver (OIDC, Zitadel, Entra, ...), so a missing type is rejected before any network call is made.","triggerScenarios":"Saving an IdP configuration where the type field is omitted or empty, e.g. {\"name\": \"idp\", \"issuer\": \"...\", \"client_id\": \"...\"}.","commonSituations":"Config templates that were written before the multi-type IdP support existed; JSON keys changed case between client and server; hand-built payloads in setup scripts.","solutions":["Set Type to one of the supported values: oidc, zitadel, entra, google, okta, pocketid, microsoft, authentik, keycloak, adfs","Check for typos in the JSON key (it must be exactly the type field the server unmarshals)"],"exampleFix":"// before\nidp := &types.IdentityProvider{Name: \"SSO\", Issuer: \"https://sso.example.com\", ClientID: \"abc\"}\n\n// after\nidp := &types.IdentityProvider{Name: \"SSO\", Type: types.IdentityProviderTypeOIDC, Issuer: \"https://sso.example.com\", ClientID: \"abc\"}","handlingStrategy":"validation","validationCode":"if idp.Type == \"\" {\n    return types.ErrIdentityProviderTypeRequired\n}","typeGuard":null,"tryCatchPattern":"if err := idp.Validate(); err != nil {\n    if errors.Is(err, types.ErrIdentityProviderTypeRequired) {\n        // default to types.IdentityProviderTypeOIDC or prompt for a choice\n    }\n    return err\n}","preventionTips":["Default the type field to \"oidc\" in templates for generic OIDC deployments","Present the supported types as a dropdown/enum in tooling instead of free text","Validate with types.IdentityProvider.Validate() before the API call"],"tags":["management","identity-provider","oidc","validation"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}