{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daytona-io/json-schema/daytona-io-create-identity-provider-schema.json",
  "title": "CreateIdentityProvider",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daytona-io-organizations-api-openapi.yml#/components/schemas/CreateIdentityProvider",
  "properties": {
    "name": {
      "description": "Display name for the identity provider",
      "type": "string"
    },
    "oidcConfig": {
      "allOf": [
        {
          "$ref": "#/$defs/OidcIdPConfig"
        }
      ],
      "description": "OIDC configuration"
    },
    "emailDomains": {
      "default": [],
      "description": "Email domains used for IdP discovery on the login form and to validate the user identity returned by the IdP. Required and must be non-empty unless `allowAnyDomain` is true.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "allowAnyDomain": {
      "default": false,
      "description": "When true, the IdP accepts any email domain returned by the external provider. Disables the post-callback domain check and allows `emailDomains` to be empty. Only enable for trusted IdPs that strictly control which users can authenticate.",
      "type": "boolean"
    },
    "trustEmailVerified": {
      "default": false,
      "description": "When true, skip the `email_verified` claim check on SSO logins through this identity provider. Only intended for providers that never emit the claim (e.g. Microsoft Entra ID). Risky: only enable if the IdP strictly controls its users' email addresses.",
      "type": "boolean"
    },
    "defaultAssignedRoleIds": {
      "default": [],
      "description": "Organization role IDs assigned to users who join the organization via SSO through this identity provider. Roles must be global or belong to this organization. Empty (default) grants the lowest access: membership with no resource permissions.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "enabled": {
      "default": true,
      "description": "Whether the identity provider is enabled",
      "type": "boolean"
    }
  },
  "required": [
    "emailDomains",
    "name",
    "oidcConfig"
  ],
  "type": "object",
  "$defs": {
    "OidcIdPConfig": {
      "properties": {
        "issuerUrl": {
          "description": "OIDC Issuer URL",
          "type": "string"
        },
        "clientId": {
          "description": "OAuth Client ID",
          "type": "string"
        },
        "clientSecret": {
          "description": "OAuth Client Secret",
          "type": "string"
        },
        "scope": {
          "description": "OAuth scopes",
          "type": "string"
        }
      },
      "required": [
        "clientId",
        "clientSecret",
        "issuerUrl"
      ],
      "type": "object"
    }
  }
}