{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beyond-identity/json-schema/beyond-identity-identity-provider-update-schema.json",
  "title": "IdentityProviderUpdate",
  "description": "Represents an identity provider.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beyond-identity-identity-provider-api-openapi.yml#/components/schemas/IdentityProviderUpdate",
  "type": "object",
  "properties": {
    "identity_provider": {
      "type": "object",
      "description": "The identity provider object.",
      "properties": {
        "id": {
          "description": "A unique identifier identifying an identity provider. This is automatically\nset on creation. This field is immutable and read-only.\n",
          "type": "string",
          "readOnly": true
        },
        "tenant_id": {
          "type": "string",
          "description": "A unique identifier for the identity provider's tenant. This is automatically\nset on creation. This field is immutable and read-only.\n",
          "readOnly": true
        },
        "realm_id": {
          "type": "string",
          "description": "A unique identifier for the identity provider's realm. This is automatically\nset on creation. This field is immutable and read-only.\n",
          "readOnly": true
        },
        "display_name": {
          "type": "string",
          "description": "The human-readable name associated with the identity provider.\n"
        },
        "protocol_config": {
          "description": "The kind of protocol we should use to communicate with the identity\nprovider.\n",
          "allOf": [
            {
              "$ref": "#/$defs/IdentityProviderUpdateProtocolConfig"
            }
          ]
        }
      }
    }
  },
  "$defs": {
    "IdentityProviderUpdateProtocolConfig": {
      "description": "Represents the protocol configuration that is used by the identity\nprovider.\n",
      "oneOf": [
        {
          "$ref": "#/$defs/IdentityProviderUpdateProtocolConfigOidcIdp"
        }
      ]
    },
    "IdentityProviderUpdateProtocolConfigOidcIdp": {
      "description": "OIDC protocol configuration for connecting to an identity provider, and\nvalidating the token we received.\n",
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "oidc_idp"
          ]
        },
        "client_id": {
          "description": "The OIDC client id. This value is from the identity provider.\n",
          "type": "string"
        },
        "client_secret": {
          "description": "The OIDC client secret. This value is from the identity provider.\n",
          "type": "string"
        },
        "token_scopes": {
          "description": "The scopes which to assign to the generated Access token. Scopes will be checked against the identity before validating.\n",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "identity_attribute": {
          "$ref": "#/$defs/SubjectField"
        },
        "pkce": {
          "$ref": "#/$defs/PkceConfig"
        },
        "jwks_url": {
          "description": "The URL that points to the \".well-known/jwks.json\" of the identity\nprovider. Must be a URL.\n",
          "type": "string"
        },
        "token_url": {
          "description": "The URL that points to the \"/token\" endpoint of the identity\nprovider. Must be a URL.\n",
          "type": "string"
        },
        "authorize_url": {
          "description": "The \"/authorize\" URL to authenticate against inside of the identity\nprovider. Must be a URL.\n",
          "type": "string"
        },
        "identifying_claim_name": {
          "description": "The name of the claim that specifies the user's identity inside of a\ntoken.\n",
          "type": "string"
        }
      }
    },
    "PkceConfig": {
      "type": "string",
      "enum": [
        "disabled",
        "plain",
        "s256"
      ],
      "description": "PKCE code challenge methods supported for applications, as defined by\n[RFC-7636](https://datatracker.ietf.org/doc/html/rfc7636). Allowable values are:\n  - `disabled` : PKCE is disabled for this application. This is the default state if\n    the `pkce` field is left blank. Please note that public OIDC and OAuth2 configured\n    applications MUST enable PKCE support. Confidential clients can leave PKCE disabled\n    if they choose.\n  - `plain` : PKCE is enabled for this application. The server will correlate the `code_challenge` and\n    `code_verifier` between the `authorize` and `token` requests. In this configuration, those fields are\n    required to be identical. This is the lower security option for PKCE support and should only be used\n    by legacy clients, or clients that don't support `s256`.\n  - `s256` : PKCE is enabled for this application, and the server will correlate the `code_challenge` and\n    `code_verifier` between the `authorize` and `token` requests. In this configuration, those fields are\n    required to equate as follows: `code_challenge` = `base64url(sha256(ascii(code_verifier)))`. This is\n    the higher security option and should always be preferred if it is supported by the client.\n"
    },
    "SubjectField": {
      "description": "Defines which field should be used to populate the subject field of an id token.\n- `id` - The user ID is used.\n- `email` - The user email is used.\n- `username` - The username is used.\n",
      "type": "string",
      "enum": [
        "id",
        "email",
        "username",
        "external_id"
      ]
    }
  }
}