Este documento ha sido traducido utilizando tecnología de traducción automática. Si bien nos esforzamos por proporcionar traducciones precisas, no ofrecemos garantías sobre la integridad, precisión o confiabilidad del contenido traducido. En caso de discrepancia, la versión original en inglés prevalecerá y constituirá el texto autorizado.

Configure Amazon Cognito

Si tu organización utiliza Amazon Cognito para la autenticación de usuarios, puedes configurar Rancher para permitir el inicio de sesión utilizando las credenciales de Amazon Cognito. Las siguientes instrucciones describen cómo configurar Rancher para trabajar con Amazon Cognito:

Requisitos previos

  • En Rancher:

    • Amazon Cognito está deshabilitado.

      Consulta la documentación de Amazon Cognito para configurar el grupo de usuarios.

  • En Amazon Cognito:

    • Crea un nuevo grupo de usuarios o utiliza uno existente.

    • En la configuración de App client, establece la URL de redirección en https://yourRancherHostURL/verify-auth. Reemplaza yourRancherHostURL con el nombre de host real de tu instancia de Rancher (por ejemplo, https://rancher.example.com/verify-auth).

Configurando Amazon Cognito en Rancher

  1. En la esquina superior izquierda de la interfaz de Rancher, haz clic en ☰ > Usuarios y Autenticación.

  2. En la barra de navegación izquierda, haz clic en Proveedor de Autenticación.

  3. Select Amazon Cognito.

  4. Completa el formulario de Configurar una cuenta de Amazon Cognito. Para obtener ayuda con el relleno del formulario, consulta la referencia de configuración.

  5. Haz clic en Habilitar.

    Rancher te redirige a la página de inicio de sesión de Amazon Cognito. Introduce tus credenciales de Amazon Cognito para validar tu configuración de Rancher.

    Es posible que necesites desactivar el bloqueador de ventanas emergentes para ver la página de inicio de sesión de Amazon Cognito.

Resultado: Rancher está configurado para trabajar con tu Amazon Cognito utilizando el protocolo OIDC. Tus usuarios ahora pueden iniciar sesión en Rancher utilizando sus credenciales de Amazon Cognito.

La búsqueda de usuarios y grupos no es compatible con Amazon Cognito. Al asignar permisos a un Proyecto o Clúster, debes introducir manualmente el UserID generado por Cognito si el usuario aún no ha iniciado sesión en Rancher. Sin embargo, si el usuario ha iniciado sesión anteriormente, puedes asignar permisos utilizando su nombre de usuario o dirección de correo electrónico.

Referencia de configuración

Campo Descripción

ID del cliente

El Client ID de tu Cliente de Aplicación de Amazon Cognito.

Secreto del Cliente

El Secreto generado de tu Cliente de Aplicación de Amazon Cognito.

Emisor

La URL del Emisor de tu Cliente de Aplicación de Amazon Cognito. Sigue el formato https://cognito-idp.{region}.amazonaws.com/{userPoolId}, y se puede encontrar en la página de configuración del Cliente de Aplicación. Rancher utiliza la URL del Emisor para obtener todas las URLs requeridas.

Soporte OIDC para la extensión PKCE

Rancher supports the Proof Key for Code Exchange (PKCE) extension (RFC 7636) for OIDC authentication providers. SHA-256 (S256) is the only supported PKCE verification method. To enable this feature, your authentication provider must use PKCE with S256 for authorization requests.

You can enable this feature by selecting Enable PKCE (S256) in your authentication provider configuration in Rancher. Enabling S256 PKCE token verification allows you to mitigate authorization code interception attacks during OIDC authentication flows.

Solución de problemas

No eres redirigido a tu proveedor de autenticación

Si completas el formulario Configurar una cuenta de Amazon Cognito y haces clic en Habilitar, y no eres redirigido a Amazon Cognito, verifica tu configuración de Amazon Cognito.

Configurando el cierre de sesión único OIDC (SLO)

Rancher supports the ability to configure OIDC Single Logout (SLO). Options include logging out of the Rancher application only, logging out of Rancher and registered applications tied to the external authentication provider, or a prompt asking the user to choose between the previous options.

Prerequisites

Before configuring OIDC SLO, ensure the following is set up on your IdP:

  • SLO Support: The Log Out behavior configuration section only appears if your OIDC IdP allows for OIDC SLO.

  • Post-Logout Redirect URI: Your Rancher Server URL must be configured as an authorized post-logout redirect URI in your IdP’s OIDC client settings. This URL is used by the IdP to redirect a user back to Rancher after a successful external logout.

OIDC SLO Configuration

Configure the SLO settings when setting up or editing your OIDC authentication provider.

  1. Sign in to Rancher using a standard user or an administrator role.

  2. In the top left corner, select > Users & Authentication.

  3. In the left navigation menu, select Auth Provider.

  4. Under the section Log Out behavior, choose the appropriate SLO setting as described below:

    Setting Description

    Log out of Rancher and not authentication provider

    Choosing this option will only logout the Rancher application and not external authentication providers.

    Log out of Rancher and authentication provider (includes all other applications registered with authentication provider)

    Choosing this option will logout Rancher and all external authentication providers along with any registered applications linked to the provider.

    Allow the user to choose one of the above in an additional log out step

    Choosing this option presents users with a choice of logout method as described above.

  5. If you choose to log out of your IdP, provide an End Session Endpoint. Rancher uses this URL to initiate the external logout.

How to get the End Session Endpoint

The end_session_endpoint is one of the specific URLs published within a standardized JSON object containing the IdP’s metadata and is retrieved from the OIDC Discovery URL. To get the end_session_endpoint from the OIDC Discovery URL, follow these steps:

  1. Obtain the Discovery URL by appending the IdP Issuer URL with the well-known path (.well-known/openid-configuration).

  2. Send an HTTP GET request to the Discovery URL.

  3. In the JSON object, look for the key named end_session_endpoint and retrieve the URL.

    You can also use a curl command to retrieve end_session_endpoint:

    curl -s <ISSUER_URL>/.well-known/openid-configuration | jq '.end_session_endpoint'