> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/supertokens/supertokens-core/llms.txt
> Use this file to discover all available pages before exploring further.

# SAML Client Configuration

> Endpoints for managing SAML client configurations

## Create or Update SAML Client

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT https://your-domain.com/recipe/saml/clients \
    -H "Content-Type: application/json" \
    -d '{
      "clientId": "my-saml-client",
      "clientSecret": "optional-secret",
      "defaultRedirectURI": "https://myapp.com/auth/callback",
      "redirectURIs": [
        "https://myapp.com/auth/callback",
        "https://myapp.com/admin/callback"
      ],
      "metadataXML": "base64-encoded-idp-metadata",
      "allowIDPInitiatedLogin": false,
      "enableRequestSigning": true
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "status": "OK",
    "clientId": "my-saml-client",
    "clientSecret": "optional-secret",
    "defaultRedirectURI": "https://myapp.com/auth/callback",
    "redirectURIs": [
      "https://myapp.com/auth/callback",
      "https://myapp.com/admin/callback"
    ],
    "idpEntityId": "https://idp.example.com",
    "idpSsoUrl": "https://idp.example.com/sso",
    "idpCertificate": "-----BEGIN CERTIFICATE-----...",
    "allowIDPInitiatedLogin": false,
    "enableRequestSigning": true,
    "createdAt": 1234567890000,
    "updatedAt": 1234567890000
  }
  ```
</ResponseExample>

<ParamField path="clientId" type="string">
  Unique identifier for this SAML client. If not provided, one will be auto-generated with prefix "st\_saml\_"
</ParamField>

<ParamField path="clientSecret" type="string">
  Optional client secret for additional security
</ParamField>

<ParamField path="defaultRedirectURI" type="string" required>
  Default redirect URI after successful authentication
</ParamField>

<ParamField path="redirectURIs" type="array" required>
  Array of allowed redirect URIs (must include defaultRedirectURI)
</ParamField>

<ParamField path="metadataXML" type="string" required>
  Base64-encoded SAML IdP metadata XML document
</ParamField>

<ParamField path="allowIDPInitiatedLogin" type="boolean">
  Whether to allow IdP-initiated login flows (default: false)
</ParamField>

<ParamField path="enableRequestSigning" type="boolean">
  Whether to sign SAML authentication requests (default: true)
</ParamField>

<ResponseField name="status" type="string">
  "OK" or "DUPLICATE\_IDP\_ENTITY\_ERROR"
</ResponseField>

<ResponseField name="clientId" type="string">
  The client identifier
</ResponseField>

<ResponseField name="idpEntityId" type="string">
  Entity ID extracted from IdP metadata
</ResponseField>

<ResponseField name="idpSsoUrl" type="string">
  SSO URL extracted from IdP metadata
</ResponseField>

<ResponseField name="idpCertificate" type="string">
  X.509 certificate extracted from IdP metadata
</ResponseField>

***

## List SAML Clients

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://your-domain.com/recipe/saml/clients/list \
    -H "Content-Type: application/json"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "status": "OK",
    "clients": [
      {
        "clientId": "my-saml-client",
        "clientSecret": "optional-secret",
        "defaultRedirectURI": "https://myapp.com/auth/callback",
        "redirectURIs": [
          "https://myapp.com/auth/callback"
        ],
        "idpEntityId": "https://idp.example.com",
        "idpSsoUrl": "https://idp.example.com/sso",
        "idpCertificate": "-----BEGIN CERTIFICATE-----...",
        "allowIDPInitiatedLogin": false,
        "enableRequestSigning": true,
        "createdAt": 1234567890000,
        "updatedAt": 1234567890000
      }
    ]
  }
  ```
</ResponseExample>

<ResponseField name="status" type="string">
  "OK"
</ResponseField>

<ResponseField name="clients" type="array">
  Array of SAML client configurations
</ResponseField>

***

## Remove SAML Client

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://your-domain.com/recipe/saml/clients/remove \
    -H "Content-Type: application/json" \
    -d '{
      "clientId": "my-saml-client"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "status": "OK",
    "didExist": true
  }
  ```
</ResponseExample>

<ParamField path="clientId" type="string" required>
  The client ID to remove
</ParamField>

<ResponseField name="status" type="string">
  "OK"
</ResponseField>

<ResponseField name="didExist" type="boolean">
  Whether the client existed before removal
</ResponseField>
