{"record":{"id":"d3b519ec6d313882","repo":"netbirdio/netbird","slug":"identity-provider-name-is-required","errorCode":null,"errorMessage":"identity provider name is required","messagePattern":"identity provider name is required","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"management/server/types/identity_provider.go","lineNumber":10,"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","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/management/server/types/identity_provider.go#L1-L28","documentation":"Sentinel error types.ErrIdentityProviderNameRequired (management/server/types/identity_provider.go:10), returned by IdentityProvider.Validate when Name is empty. It is the first check when an admin saves an identity provider configuration for an account, and the management API surfaces it as an InvalidArgument status.","triggerScenarios":"Creating or updating an IdP configuration (admin API/handler that calls validateIdentityProviderConfig) with an empty name field.","commonSituations":"Programmatic setup of self-hosted management that copies an IdP JSON template and forgets the name; migrating IdP config between accounts where name was optional in the old tooling.","solutions":["Provide a non-empty Name (any human-readable label, e.g. \"Corporate Okta\") in the IdP payload","If generating config from environment files, assert the name variable is set before calling the API"],"exampleFix":"// before\nidp := &types.IdentityProvider{Type: \"okta\", Issuer: \"https://okta.example.com\", ClientID: \"abc\"}\n\n// after\nidp := &types.IdentityProvider{Name: \"Corporate Okta\", Type: \"okta\", Issuer: \"https://okta.example.com\", ClientID: \"abc\"}","handlingStrategy":"validation","validationCode":"if idp.Name == \"\" {\n    return types.ErrIdentityProviderNameRequired // or a client-side equivalent\n}","typeGuard":null,"tryCatchPattern":"if err := idp.Validate(); err != nil {\n    if errors.Is(err, types.ErrIdentityProviderNameRequired) {\n        // prompt for the IdP display name\n    }\n    return err\n}","preventionTips":["Reuse types.IdentityProvider.Validate() client-side when your tooling imports the management types package","Make name required in config schemas (JSON schema/Terraform) used to build IdP payloads","Smoke-test IdP provisioning in a pipeline so empty-template bugs fail fast"],"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"}