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

> Aprenda a conectarse con proveedores de identidad SAML mediante una conexión empresarial.

# Conecte su aplicación con proveedores de identidad SAML

export const AuthCodeGroup = ({children, dropdown}) => {
  const [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        const processChildren = node => {
          if (typeof node === "string") {
            let processedNode = node;
            for (const [key, value] of window.rootStore.variableStore.values.entries()) {
              const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
              processedNode = processedNode.replaceAll(new RegExp(escapedKey, "g"), value);
            }
            return processedNode;
          } else if (Array.isArray(node)) {
            return node.map(processChildren);
          } else if (node && node.props && node.props.children) {
            return {
              ...node,
              props: {
                ...node.props,
                children: processChildren(node.props.children)
              }
            };
          }
          return node;
        };
        setProcessedChildren(processChildren(children));
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeGroup dropdown={dropdown}>{processedChildren}</CodeGroup>;
};

export const AuthCodeBlock = ({filename, icon, language, highlight, children}) => {
  const [displayText, setDisplayText] = useState(children);
  const [copyText, setCopyText] = useState(children);
  const wrapperRef = React.useRef(null);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      if (!window.autorun || !window.rootStore) {
        return;
      }
      unsubscribe = window.autorun(() => {
        let processedChildrenForDisplay = children;
        let processedChildrenForCopy = children;
        for (const [key, value] of window.rootStore.variableStore.values.entries()) {
          const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
          let displayValue = value;
          if (key === "{yourClientSecret}" && value !== "{yourClientSecret}") {
            displayValue = value.substring(0, 3) + "*****ENMASCARADO*****";
          }
          processedChildrenForDisplay = processedChildrenForDisplay.replaceAll(new RegExp(escapedKey, "g"), displayValue);
          processedChildrenForCopy = processedChildrenForCopy.replaceAll(new RegExp(escapedKey, "g"), value);
        }
        setDisplayText(processedChildrenForDisplay);
        setCopyText(processedChildrenForCopy);
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  useEffect(() => {
    if (!wrapperRef.current) return;
    const originalWriteText = navigator.clipboard.writeText.bind(navigator.clipboard);
    let isOverriding = false;
    const handleClick = e => {
      const button = e.target.closest('[data-testid="copy-code-button"]');
      if (!button || !wrapperRef.current.contains(button)) return;
      isOverriding = true;
      navigator.clipboard.writeText = text => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
          return originalWriteText(copyText);
        }
        return originalWriteText(text);
      };
      setTimeout(() => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
        }
      }, 100);
    };
    const wrapper = wrapperRef.current;
    wrapper.addEventListener('click', handleClick, true);
    return () => {
      wrapper.removeEventListener('click', handleClick, true);
      if (navigator.clipboard.writeText !== originalWriteText) {
        navigator.clipboard.writeText = originalWriteText;
      }
    };
  }, [copyText]);
  return <div ref={wrapperRef}>
      <CodeBlock filename={filename} icon={icon} language={language} lines highlight={highlight}>
        {displayText}
      </CodeBlock>
    </div>;
};

Auth0 le permite crear conexiones de <Tooltip tip="Security Assertion Markup Language (SAML): Protocolo estandarizado que permite a dos partes intercambiar información de autenticación sin contraseña." cta="Ver glosario" href="/es/docs/glossary?term=SAML">SAML</Tooltip> <Tooltip tip="Security Assertion Markup Language (SAML): Protocolo estandarizado que permite a dos partes intercambiar información de autenticación sin contraseña." cta="Ver glosario" href="/es/docs/glossary?term=Identity+Provider">Proveedor de identidad</Tooltip> (IdP).

<div id="prerequisites">
  ## Requisitos previos
</div>

Antes de comenzar:

* [Registre su aplicación en Auth0](/es/docs/get-started/auth0-overview/create-applications).

  * Seleccione un **tipo de aplicación** adecuado.
  * Agregue una **URL de callback permitida** de **`{https://yourApp/callback}`**.
  * Asegúrese de que los [tipos de concesión](/es/docs/get-started/applications/update-grant-types) de su aplicación incluyan los flujos adecuados.
* Decida el nombre de esta conexión empresarial

  * La URL de retorno (también llamada URL del Assertion Consumer Service) pasa a ser: `https://{yourDomain}/login/callback?connection={yourConnectionName}`
  * El ID de entidad pasa a ser: `urn:auth0:{yourTenant}:{yourConnectionName}`

<div id="steps">
  ## Pasos
</div>

Para conectar su aplicación a un proveedor de identidad SAML, debe:

1. Introducir la URL de retorno y el ID de entidad en el IdP (para obtener más información, consulte [Opciones de configuración del proveedor de identidad SAML](/es/docs/authenticate/protocols/saml/saml-identity-provider-configuration-settings)).
2. [Obtener el certificado de firma del IdP](#get-the-signing-certificate-from-the-idp) y [convertirlo a Base64](#convert-signing-certificate-to-base64).
3. [Crear una conexión empresarial en Auth0](#create-an-enterprise-connection-in-auth0).
4. [Habilitar la conexión empresarial para su aplicación de Auth0](#enable-the-enterprise-connection-for-your-auth0-application).
5. [Configurar asignaciones](#set-up-mappings) (innecesario en la mayoría de los casos).
6. [Probar la conexión](#test-the-connection).

<div id="get-the-signing-certificate-from-the-idp">
  ## Obtenga el certificado de firma del IdP
</div>

Con SAML Login, Auth0 actúa como proveedor de servicios, por lo que deberá obtener un certificado de firma X.509 del IdP de SAML (en formato PEM o CER); más adelante, lo cargará en Auth0. Los métodos para obtener este certificado varían, así que consulte la documentación de su IdP si necesita ayuda adicional.

<div id="convert-signing-certificate-to-base64">
  ### Convertir el certificado de firma a Base64
</div>

Puede usar la <Tooltip tip="Management API: Un producto que permite a los clientes realizar tareas administrativas." cta="Ver glosario" href="/es/docs/glossary?term=Management+API">Management API</Tooltip> o el <Tooltip tip="Management API: Un producto que permite a los clientes realizar tareas administrativas." cta="Ver glosario" href="/es/docs/glossary?term=Auth0+Dashboard">Auth0 Dashboard</Tooltip> para cargar el certificado de firma X.509. Si usa la Management API, debe convertir el archivo a Base64. Para ello, use una [sencilla herramienta en línea](https://www.base64decode.org/) o ejecute el siguiente comando en Bash: `cat signing-cert.crt | base64`.

<div id="assertion-encryption">
  ## Cifrado de aserciones
</div>

Si tus aserciones SAML están cifradas, debes [configurar valores adicionales](/es/docs/authenticate/protocols/saml/saml-sso-integrations/algorithm-profiles) para tu conexión a fin de indicarle a Auth0 cómo debe gestionar el descifrado.

<div id="create-an-enterprise-connection-in-auth0">
  ## Crear una conexión empresarial en Auth0
</div>

A continuación, deberá crear y configurar una conexión empresarial SAML en Auth0, y cargar su certificado de firma X.509. Esta tarea puede realizarse mediante el Dashboard de Auth0 o la Management API.

<div id="create-an-enterprise-connection-using-the-dashboard">
  ### Crear una conexión empresarial con el Dashboard
</div>

1. Vaya a [Auth0 Dashboard > Authentication > Enterprise](https://manage.auth0.com/#/connections/enterprise), busque **SAML** y seleccione el icono `+`.

   <Frame>
     <img src="https://mintcdn.com/translations/eVsQcTnbClN-oB7d/docs/images/cdy7uua7fh8z/1fSTcrZpkgkPR64NnI1lr8/b3454e60a4463e99353603fd11a71983/Enterprise_Connections_-_EN.png?fit=max&auto=format&n=eVsQcTnbClN-oB7d&q=85&s=d70364390d8c16ca8efe20e3e1795db4" alt="Dashboard - Conexiones - Enterprise" width="600" height="561" data-path="docs/images/cdy7uua7fh8z/1fSTcrZpkgkPR64NnI1lr8/b3454e60a4463e99353603fd11a71983/Enterprise_Connections_-_EN.png" />
   </Frame>
2. Introduzca los detalles de la conexión y seleccione **Crear:**

| Campo                                          | Descripción                                                                                                                                                                                                               |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Nombre de la conexión**                      | Identificador lógico de la conexión; debe ser único para su inquilino y coincidir con el nombre que se usa al configurar la Post-back URL y el Entity ID en el IdP. Una vez establecido, este nombre no se puede cambiar. |
| **URL de inicio de sesión**                    | URL de inicio de sesión único de SAML.                                                                                                                                                                                    |
| **Certificado de firma X.509**                 | Certificado de firma (codificado en PEM o CER) que recuperó antes del IdP durante este proceso.                                                                                                                           |
| **Habilitar cierre de sesión**                 | Cuando está habilitado, se puede establecer una URL de cierre de sesión específica. De lo contrario, se usa de forma predeterminada la URL de inicio de sesión.                                                           |
| **URL de cierre de sesión** (opcional)         | URL de cierre de sesión único de SAML.                                                                                                                                                                                    |
| **Atributo de ID de usuario** (opcional)       | Atributo del token SAML que se asignará a la propiedad `user_id` en Auth0.                                                                                                                                                |
| **Modo de depuración**                         | Cuando está habilitado, se generarán registros más detallados durante el proceso de autenticación.                                                                                                                        |
| **Firmar solicitud**                           | Cuando está habilitado, la solicitud de autenticación SAML se firmará. (Asegúrese de descargar y proporcionar el certificado correspondiente para que el IdP de SAML pueda validar la firma de las aserciones).           |
| **Algoritmo de firma de solicitud**            | Algoritmo que Auth0 usará para firmar las aserciones SAML.                                                                                                                                                                |
| **Algoritmo de resumen de firma de solicitud** | Algoritmo que Auth0 usará para el resumen de la firma de la solicitud.                                                                                                                                                    |
| **Vinculación de protocolo**                   | Vinculación HTTP compatible con el IdP.                                                                                                                                                                                   |
| **Plantilla de solicitud** (opcional)          | Plantilla que da formato a la solicitud SAML.                                                                                                                                                                             |

<Frame>
  <img src="https://mintcdn.com/translations/c0RQ9V0YAcT0-8l5/docs/images/cdy7uua7fh8z/7hvlp8kjva9uFzm5nwsBTQ/4c9f4d01438a3dab6cfb19a5d61d3f13/SAML_Connection_2.png?fit=max&auto=format&n=c0RQ9V0YAcT0-8l5&q=85&s=d1866ce05cbdd547a28f883b5f6018f9" alt="Configurar ajustes de SAML" width="736" height="1488" data-path="docs/images/cdy7uua7fh8z/7hvlp8kjva9uFzm5nwsBTQ/4c9f4d01438a3dab6cfb19a5d61d3f13/SAML_Connection_2.png" />
</Frame>

3\. En la vista **Provisioning**, configure cómo se crean y actualizan los perfiles de usuario en Auth0.

| Campo                                                                    | Descripción                                                                                                                                                                                                                         |
| ------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Sincronizar atributos del perfil de usuario en cada inicio de sesión** | Cuando está habilitado, Auth0 sincroniza automáticamente los datos del perfil del usuario en cada inicio de sesión, lo que garantiza que los cambios realizados en el origen de la conexión se actualicen automáticamente en Auth0. |
| **Sincronizar perfiles de usuario usando SCIM**                          | Cuando está habilitado, Auth0 permite sincronizar los datos del perfil de usuario mediante SCIM. Para obtener más información, consulte [Configure Inbound SCIM](/es/docs/authenticate/protocols/scim/configure-inbound-scim).      |

4. En la vista **Login Experience**, configure cómo inician sesión los usuarios con esta conexión.

| Campo                                     | Descripción                                                                                                                                                                                                                                                               |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Home Realm Discovery**                  | Compara el dominio de correo electrónico de un usuario con los dominios del Proveedor de identidad proporcionados. Para obtener más información, consulte [Configure Identifier First Authentication](/es/docs/authenticate/login/auth0-universal-login/identifier-first) |
| **Mostrar botón de conexión**             | Esta opción muestra las siguientes opciones para personalizar el botón de conexión de su aplicación.                                                                                                                                                                      |
| **Nombre visible del botón** (Opcional)   | Texto que se usa para personalizar el botón de inicio de sesión de Universal Login. Cuando se establece, el botón muestra: "Continuar con \{Nombre visible del botón}".                                                                                                   |
| **URL del logotipo del botón** (Opcional) | URL de la imagen que se usa para personalizar el botón de inicio de sesión de Universal Login. Cuando se establece, el botón de inicio de sesión de Universal Login muestra la imagen como un cuadrado de 20 px por 20 px.                                                |

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Los campos opcionales solo están disponibles con Universal Login. Los clientes que usan Classic Login no verán el botón Add, Nombre visible del botón ni URL del logotipo del botón.
</Callout>

5. Si tiene los permisos administrativos adecuados para completar la integración, haga clic en **Continuar** para conocer los parámetros personalizados necesarios para configurar su IdP. De lo contrario, proporcione la URL indicada a su administrador para que pueda ajustar la configuración requerida.

<div id="create-an-enterprise-connection-using-the-management-api">
  ### Crear una conexión empresarial con la Management API
</div>

También puede usar la [Management API](https://auth0.com/docs/api/management/v2) para crear su conexión SAML. Al hacerlo, puede optar por especificar manualmente cada campo de configuración de SAML o, en su lugar, indicar un documento de metadatos SAML que contenga los valores de configuración.

<div id="create-a-connection-using-specified-values">
  #### Crear una conexión con los valores especificados
</div>

Realice una llamada `POST` al [endpoint Create a Connection](https://auth0.com/docs/api/management/v2#!/Connections/patch_connections_by_id). Asegúrese de reemplazar los valores de marcador de posición `MGMT_API_ACCESS_TOKEN`, `CONNECTION_NAME`, `SIGN_IN_ENDPOINT_URL`, `SIGN_OUT_ENDPOINT_URL` y `BASE64_SIGNING_CERT` por su <Tooltip tip="Token de acceso: credencial de autorización, en forma de una cadena opaca o JWT, que se usa para acceder a una API." cta="Ver glosario" href="/es/docs/glossary?term=Access+Token">Token de acceso</Tooltip> de Management API, el nombre de la conexión, la URL de inicio de sesión, la URL de cierre de sesión y el certificado de firma codificado en Base64 (en formato PEM o CER), respectivamente.

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://{yourDomain}/api/v2/connections' \
    --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
    --header 'cache-control: no-cache' \
    --header 'content-type: application/json' \
    --data '{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "signInEndpoint": "SIGN_IN_ENDPOINT_URL", "signOutEndpoint": "SIGN_OUT_ENDPOINT_URL", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "fieldsMap": {}, "signingCert": "BASE64_SIGNING_CERT" } }'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{yourDomain}/api/v2/connections");
  var request = new RestRequest(Method.POST);
  request.AddHeader("content-type", "application/json");
  request.AddHeader("authorization", "Bearer MGMT_API_ACCESS_TOKEN");
  request.AddHeader("cache-control", "no-cache");
  request.AddParameter("application/json", "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "signInEndpoint": "SIGN_IN_ENDPOINT_URL", "signOutEndpoint": "SIGN_OUT_ENDPOINT_URL", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "fieldsMap": {}, "signingCert": "BASE64_SIGNING_CERT" } }", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/connections"

  	payload := strings.NewReader("{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "signInEndpoint": "SIGN_IN_ENDPOINT_URL", "signOutEndpoint": "SIGN_OUT_ENDPOINT_URL", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "fieldsMap": {}, "signingCert": "BASE64_SIGNING_CERT" } }")

  	req, _ := http.NewRequest("POST", url, payload)

  	req.Header.Add("content-type", "application/json")
  	req.Header.Add("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
  	req.Header.Add("cache-control", "no-cache")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.post("https://{yourDomain}/api/v2/connections")
    .header("content-type", "application/json")
    .header("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
    .header("cache-control", "no-cache")
    .body("{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "signInEndpoint": "SIGN_IN_ENDPOINT_URL", "signOutEndpoint": "SIGN_OUT_ENDPOINT_URL", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "fieldsMap": {}, "signingCert": "BASE64_SIGNING_CERT" } }")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'POST',
    url: 'https://{yourDomain}/api/v2/connections',
    headers: {
      'content-type': 'application/json',
      authorization: 'Bearer MGMT_API_ACCESS_TOKEN',
      'cache-control': 'no-cache'
    },
    data: {
      strategy: 'samlp',
      name: 'CONNECTION_NAME',
      options: {
        signInEndpoint: 'SIGN_IN_ENDPOINT_URL',
        signOutEndpoint: 'SIGN_OUT_ENDPOINT_URL',
        signatureAlgorithm: 'rsa-sha256',
        digestAlgorithm: 'sha256',
        fieldsMap: {},
        signingCert: 'BASE64_SIGNING_CERT'
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/connections",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "signInEndpoint": "SIGN_IN_ENDPOINT_URL", "signOutEndpoint": "SIGN_OUT_ENDPOINT_URL", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "fieldsMap": {}, "signingCert": "BASE64_SIGNING_CERT" } }",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer MGMT_API_ACCESS_TOKEN",
      "cache-control: no-cache",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "signInEndpoint": "SIGN_IN_ENDPOINT_URL", "signOutEndpoint": "SIGN_OUT_ENDPOINT_URL", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "fieldsMap": {}, "signingCert": "BASE64_SIGNING_CERT" } }"

  headers = {
      'content-type': "application/json",
      'authorization': "Bearer MGMT_API_ACCESS_TOKEN",
      'cache-control': "no-cache"
      }

  conn.request("POST", "/{yourDomain}/api/v2/connections", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/connections")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Post.new(url)
  request["content-type"] = 'application/json'
  request["authorization"] = 'Bearer MGMT_API_ACCESS_TOKEN'
  request["cache-control"] = 'no-cache'
  request.body = "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "signInEndpoint": "SIGN_IN_ENDPOINT_URL", "signOutEndpoint": "SIGN_OUT_ENDPOINT_URL", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "fieldsMap": {}, "signingCert": "BASE64_SIGNING_CERT" } }"

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

| Valor                   | Descripción                                                                                                                  |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `MGMT_API_ACCESS_TOKEN` | [Token de acceso para la Management API](https://auth0.com/docs/api/management/v2/tokens) con el scope `create:connections`. |
| `CONNECTION_NAME`       | El nombre de la conexión que se va a crear.                                                                                  |
| `SIGN_IN_ENDPONT_URL`   | URL de inicio de sesión único de SAML para la conexión que se va a crear.                                                    |
| `SIGN_OUT_ENDPOINT_URL` | URL de cierre de sesión único de SAML para la conexión que se va a crear.                                                    |
| `BASE64_SIGNING_CERT`   | Certificado de firma X.509 (codificado en PEM o CER) que obtuvo del IdP.                                                     |

O, en JSON:

```json lines theme={null}
{
	"strategy": "samlp",
  	"name": "CONNECTION_NAME",
  	"options": {
    	"signInEndpoint": "SIGN_IN_ENDPOINT_URL",
    	"signOutEndpoint": "SIGN_OUT_ENDPOINT_URL",
    	"signatureAlgorithm": "rsa-sha256",
    	"digestAlgorithm": "sha256",
    	"fieldsMap": {
     		...
    	},
    	"signingCert": "BASE64_SIGNING_CERT"
  	}
}
```

<div id="create-a-connection-using-saml-metadata">
  #### Crear una conexión mediante metadatos SAML
</div>

En lugar de especificar cada campo de la configuración de SAML, puede indicar un documento de metadatos SAML que contenga los valores de configuración. Al indicar un documento de metadatos SAML, puede proporcionar el contenido XML del documento (`metadataXml`) o la URL del documento (`metadataUrl`). Si proporciona la URL, el contenido se descarga solo una vez; la conexión no se reconfigurará automáticamente si el contenido de la URL cambia en el futuro.

<div id="provide-metadata-document-content">
  ##### Proporcione el contenido del documento de metadatos
</div>

Use la opción `metadataXml` para proporcionar el contenido del documento:

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://{yourDomain}/api/v2/connections' \
    --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
    --header 'cache-control: no-cache' \
    --header 'content-type: application/json' \
    --data '{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataXml": "<EntityDescriptor entityID='''urn:saml-idp''' xmlns='''urn:oasis:names:tc:SAML:2.0:metadata'''>...</EntityDescriptor>" } }'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{yourDomain}/api/v2/connections");
  var request = new RestRequest(Method.POST);
  request.AddHeader("content-type", "application/json");
  request.AddHeader("authorization", "Bearer MGMT_API_ACCESS_TOKEN");
  request.AddHeader("cache-control", "no-cache");
  request.AddParameter("application/json", "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataXml": "<EntityDescriptor entityID='urn:saml-idp' xmlns='urn:oasis:names:tc:SAML:2.0:metadata'>...</EntityDescriptor>" } }", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/connections"

  	payload := strings.NewReader("{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataXml": "<EntityDescriptor entityID='urn:saml-idp' xmlns='urn:oasis:names:tc:SAML:2.0:metadata'>...</EntityDescriptor>" } }")

  	req, _ := http.NewRequest("POST", url, payload)

  	req.Header.Add("content-type", "application/json")
  	req.Header.Add("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
  	req.Header.Add("cache-control", "no-cache")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.post("https://{yourDomain}/api/v2/connections")
    .header("content-type", "application/json")
    .header("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
    .header("cache-control", "no-cache")
    .body("{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataXml": "<EntityDescriptor entityID='urn:saml-idp' xmlns='urn:oasis:names:tc:SAML:2.0:metadata'>...</EntityDescriptor>" } }")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'POST',
    url: 'https://{yourDomain}/api/v2/connections',
    headers: {
      'content-type': 'application/json',
      authorization: 'Bearer MGMT_API_ACCESS_TOKEN',
      'cache-control': 'no-cache'
    },
    data: {
      strategy: 'samlp',
      name: 'CONNECTION_NAME',
      options: {
        metadataXml: '<EntityDescriptor entityID='urn:saml-idp' xmlns='urn:oasis:names:tc:SAML:2.0:metadata'>...</EntityDescriptor>'
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/connections",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataXml": "<EntityDescriptor entityID='urn:saml-idp' xmlns='urn:oasis:names:tc:SAML:2.0:metadata'>...</EntityDescriptor>" } }",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer MGMT_API_ACCESS_TOKEN",
      "cache-control: no-cache",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  iimport http.client

  conn = http.client.HTTPSConnection("")

  payload = "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataXml": "<EntityDescriptor entityID='urn:saml-idp' xmlns='urn:oasis:names:tc:SAML:2.0:metadata'>...</EntityDescriptor>" } }"

  headers = {
      'content-type': "application/json",
      'authorization': "Bearer MGMT_API_ACCESS_TOKEN",
      'cache-control': "no-cache"
      }

  conn.request("POST", "/{yourDomain}/api/v2/connections", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/connections")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Post.new(url)
  request["content-type"] = 'application/json'
  request["authorization"] = 'Bearer MGMT_API_ACCESS_TOKEN'
  request["cache-control"] = 'no-cache'
  request.body = "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataXml": "<EntityDescriptor entityID='urn:saml-idp' xmlns='urn:oasis:names:tc:SAML:2.0:metadata'>...</EntityDescriptor>" } }"

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

<div id="provide-a-metadata-document-url">
  ##### Proporcione la URL de un documento de metadatos
</div>

Use la opción `metadataUrl` para indicar la URL del documento:

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://{yourDomain}/api/v2/connections' \
    --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
    --header 'cache-control: no-cache' \
    --header 'content-type: application/json' \
    --data '{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX" } }'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{yourDomain}/api/v2/connections");
  var request = new RestRequest(Method.POST);
  request.AddHeader("content-type", "application/json");
  request.AddHeader("authorization", "Bearer MGMT_API_ACCESS_TOKEN");
  request.AddHeader("cache-control", "no-cache");
  request.AddParameter("application/json", "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX" } }", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{yourDomain}/api/v2/connections"

  	payload := strings.NewReader("{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX" } }")

  	req, _ := http.NewRequest("POST", url, payload)

  	req.Header.Add("content-type", "application/json")
  	req.Header.Add("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
  	req.Header.Add("cache-control", "no-cache")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.post("https://{yourDomain}/api/v2/connections")
    .header("content-type", "application/json")
    .header("authorization", "Bearer MGMT_API_ACCESS_TOKEN")
    .header("cache-control", "no-cache")
    .body("{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX" } }")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'POST',
    url: 'https://{yourDomain}/api/v2/connections',
    headers: {
      'content-type': 'application/json',
      authorization: 'Bearer MGMT_API_ACCESS_TOKEN',
      'cache-control': 'no-cache'
    },
    data: {
      strategy: 'samlp',
      name: 'CONNECTION_NAME',
      options: {
        metadataUrl: 'https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX'
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{yourDomain}/api/v2/connections",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX" } }",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer MGMT_API_ACCESS_TOKEN",
      "cache-control: no-cache",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX" } }"

  headers = {
      'content-type': "application/json",
      'authorization': "Bearer MGMT_API_ACCESS_TOKEN",
      'cache-control': "no-cache"
      }

  conn.request("POST", "/{yourDomain}/api/v2/connections", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{yourDomain}/api/v2/connections")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Post.new(url)
  request["content-type"] = 'application/json'
  request["authorization"] = 'Bearer MGMT_API_ACCESS_TOKEN'
  request["cache-control"] = 'no-cache'
  request.body = "{ "strategy": "samlp", "name": "CONNECTION_NAME", "options": { "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX" } }"

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

Cuando se proporciona la URL, el contenido se descarga solo una vez; la conexión no se reconfigura automáticamente si el contenido de la URL cambia en el futuro.

<div id="refresh-existing-connection-information-with-metadata-url">
  ##### Actualice la información de una conexión existente con la URL de metadatos
</div>

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
  Este proceso solo funcionará si la conexión se creó manualmente con `metadataUrl`.
</Callout>

Si tiene una implementación B2B y federa con Auth0 mediante su propio proveedor de identidad SAML, es posible que necesite actualizar la información de la conexión almacenada en Auth0, como cambios en el certificado de firma, cambios en la URL del endpoint o nuevos campos de aserción. Auth0 lo hace automáticamente para las conexiones ADFS, pero no para las conexiones SAML.

Puede crear un proceso por lotes (`cron job`) para realizar una actualización periódica. El proceso puede ejecutarse cada pocas semanas y realizar una llamada PATCH al endpoint `/api/v2/connections/CONNECTION_ID`, pasando un cuerpo que contenga `{options: {metadataUrl: '$URL'}}`, donde `$URL` es la misma URL de metadatos con la que creó la conexión. Use la URL de metadatos para crear una nueva conexión temporal y luego comparar las propiedades de la conexión antigua y la nueva. Si hay alguna diferencia, actualice la nueva conexión y luego elimine la conexión temporal.

1. Cree una conexión SAML con `options.metadataUrl`. El objeto de conexión se completará con la información de los metadatos.
2. Actualice el contenido de los metadatos en la URL.
3. Envíe un PATCH al endpoint `/api/v2/connections/CONNECTION_ID` con `{options: {metadataUrl: '$URL'}}`. Ahora el objeto de conexión se actualiza con el nuevo contenido de los metadatos.

<Warning>
  Si usa el parámetro `options`, sobrescribirá todo el objeto `options`. Asegúrese de que todos los parámetros estén presentes.
</Warning>

<div id="specify-a-custom-entity-id">
  ## Especifique un ID de entidad personalizado
</div>

Para especificar un ID de entidad personalizado, use la Management API para reemplazar el valor predeterminado `urn:auth0:YOUR_TENANT:YOUR_CONNECTION_NAME`. Establezca la propiedad `connection.options.entityID` cuando se cree la conexión por primera vez o al actualizar una conexión existente.

El siguiente ejemplo de JSON puede usarse para crear una nueva conexión SAML mediante la URL de metadatos del IdP de SAML y, al mismo tiempo, especificar un ID de entidad personalizado. El ID de entidad sigue siendo único, ya que se crea con el nombre de la conexión.

```json lines theme={null}
{
  "strategy": "samlp", 
  "name": "{yourConnectionName}", 
  "options": { 
    "metadataUrl": "https://saml-idp/samlp/metadata/uarlU13n63e0feZNJxOCNZ1To3a9H7jX",
    "entityId": "urn:your-custom-sp-name:{yourConnectionName}"
  }
}
```

<div id="enable-the-enterprise-connection-for-your-auth0-application">
  ## Habilitar la conexión empresarial para su aplicación de Auth0
</div>

Para usar su nueva conexión empresarial SAML, primero debe [habilitar la conexión](/es/docs/authenticate/identity-providers/enterprise-identity-providers/enable-enterprise-connections) en sus aplicaciones de Auth0.

<div id="set-up-mappings">
  ## Configurar asignaciones
</div>

<Warning>
  Si está configurando una conexión empresarial SAML para un servidor PingFederate no estándar, **debe** actualizar las asignaciones de atributos.
</Warning>

Seleccione la vista **Mappings**, introduzca las asignaciones entre `{}` y seleccione **Guardar**.

<Frame>
  <img src="https://mintcdn.com/translations/3nS3prIggmJG9TUI/docs/images/cdy7uua7fh8z/3matGqveShEDX89p8Bcmwr/df5f37c9fb98447badddb1622f79ad95/2025-02-25_09-35-58.png?fit=max&auto=format&n=3nS3prIggmJG9TUI&q=85&s=9e220fee57ff4e2baa09fcc90bcf9598" alt="Configurar asignaciones de SAML" width="599" height="472" data-path="docs/images/cdy7uua7fh8z/3matGqveShEDX89p8Bcmwr/df5f37c9fb98447badddb1622f79ad95/2025-02-25_09-35-58.png" />
</Frame>

**Asignaciones para servidores PingFederate no estándar:**

```json lines theme={null}
{
    "user_id": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
    "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"
}
```

**Asignaciones para <Tooltip tip="Single Sign-On (SSO): Servicio que, después de que un usuario inicia sesión en una aplicación, inicia automáticamente la sesión de ese usuario en otras aplicaciones." cta="Ver glosario" href="/es/docs/glossary?term=SSO">SSO</Tooltip> Circle**

```json lines theme={null}
{
  "email": "EmailAddress",
  "given_name": "FirstName",
  "family_name": "LastName"
}
```

**Asignar una de estas dos claims a un atributo de usuario**

```json lines theme={null}
{
  "given_name": [
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
  ]
}
```

**Cómo asignar el identificador de nombre a un atributo del usuario**

```json lines theme={null}
{
  "user_id": [
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
  ]
}
```

<div id="test-the-connection">
  ## Pruebe la conexión
</div>

Ahora puede [probar la conexión](/es/docs/authenticate/identity-providers/enterprise-identity-providers/test-enterprise-connections).

<div id="configure-global-token-revocation">
  ## Configurar la revocación global de tokens
</div>

Este tipo de conexión admite un endpoint de revocación global de tokens, que permite a un proveedor de identidad compatible revocar las sesiones de usuario de Auth0, revocar los <Tooltip tip="Token de actualización: token que se usa para obtener un nuevo Token de acceso sin obligar a los usuarios a volver a iniciar sesión." cta="Ver glosario" href="/es/docs/glossary?term=refresh+tokens">tokens de actualización</Tooltip> y activar el cierre de sesión por canal secundario para las aplicaciones que usan un canal secundario seguro.

Esta función se puede usar con Universal Logout en Okta Workforce Identity.

Para obtener más información e instrucciones de configuración, consulta [Universal Logout](/es/docs/authenticate/login/logout/universal-logout).

<div id="learn-more">
  ## Más información
</div>

* [Universal Logout](/es/docs/authenticate/login/logout/universal-logout)
