Ce document a été traduit à l'aide d'une technologie de traduction automatique. Bien que nous nous efforcions de fournir des traductions exactes, nous ne fournissons aucune garantie quant à l'exhaustivité, l'exactitude ou la fiabilité du contenu traduit. En cas de divergence, la version originale anglaise prévaut et fait foi.

Configurer Amazon Cognito

Si votre organisation utilise Amazon Cognito pour l’authentification des utilisateurs, vous pouvez configurer Rancher pour permettre la connexion avec les identifiants d’Amazon Cognito. Les instructions suivantes décrivent comment configurer Rancher pour fonctionner avec Amazon Cognito :

Conditions préalables

  • Dans Rancher :

    • Amazon Cognito est désactivé.

      Consultez la documentation d’Amazon Cognito pour configurer le pool d’utilisateurs.

  • Dans Amazon Cognito :

    • Créez un nouveau pool d’utilisateurs ou utilisez un pool existant.

    • Dans les paramètres App client, définissez l’URL de redirection sur https://yourRancherHostURL/verify-auth. Remplacez yourRancherHostURL par le nom d’hôte réel de votre instance Rancher (par exemple, https://rancher.example.com/verify-auth).

Configurer Amazon Cognito dans Rancher

  1. Dans le coin supérieur gauche de l’interface utilisateur de Rancher, cliquez sur ☰ > Utilisateurs et authentification.

  2. Dans la barre de navigation à gauche, cliquez sur Fournisseur d’authentification.

  3. Sélectionnez Amazon Cognito.

  4. Complétez le formulaire Configurer un compte Amazon Cognito. Pour obtenir de l’aide sur le remplissage du formulaire, consultez la référence de configuration.

  5. Cliquez sur Activer.

    Rancher vous redirige vers la page de connexion d’Amazon Cognito. Entrez vos identifiants Amazon Cognito pour valider votre configuration Rancher.

    Vous devrez peut-être désactiver votre bloqueur de fenêtres contextuelles pour voir la page de connexion Amazon Cognito.

Résultat : Rancher est configuré pour fonctionner avec votre Amazon Cognito en utilisant le protocole OIDC. Vos utilisateurs peuvent désormais se connecter à Rancher en utilisant leurs identifiants Amazon Cognito.

La recherche d’utilisateurs et de groupes n’est pas prise en charge pour Amazon Cognito. Lors de l’attribution de permissions à un projet ou à un cluster, vous devez entrer manuellement l’UserID généré par Cognito si l’utilisateur ne s’est pas encore connecté à Rancher. Cependant, si l’utilisateur s’est déjà connecté, vous pouvez attribuer des permissions en utilisant son nom d’utilisateur ou son adresse e-mail.

Référence de configuration :

Champ Description

ID du client

L’ID client de votre client d’application Amazon Cognito.

Secret du client

Le secret généré de votre client d’application Amazon Cognito.

Émetteur

L’URL de l’émetteur de votre client d’application Amazon Cognito. Elle suit le format https://cognito-idp.{region}.amazonaws.com/{userPoolId}, et peut être trouvée dans la page des paramètres du client d’application. Rancher utilise l’URL de l’émetteur pour récupérer toutes les URL requises.

Support OIDC pour l’extension 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.

Dépannage

Vous n’êtes pas redirigé vers votre fournisseur d’authentification.

Si vous remplissez le formulaire Configurer un compte Amazon Cognito et cliquez sur Activer, et que vous n’êtes pas redirigé vers Amazon Cognito, vérifiez votre configuration Amazon Cognito.

Configuration de la déconnexion unique 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'