Este documento foi traduzido usando tecnologia de tradução automática de máquina. Sempre trabalhamos para apresentar traduções precisas, mas não oferecemos nenhuma garantia em relação à integridade, precisão ou confiabilidade do conteúdo traduzido. Em caso de qualquer discrepância, a versão original em inglês prevalecerá e constituirá o texto official.

Configure Amazon Cognito

Se sua organização usa o Amazon Cognito para autenticação de usuários, você pode configurar o Rancher para permitir login usando as credenciais do Amazon Cognito. As seguintes instruções descrevem como configurar o Rancher para trabalhar com o Amazon Cognito:

Pré-requisitos

  • No Rancher:

    • O Amazon Cognito está desativado.

      Consulte a documentação do Amazon Cognito para configurar o pool de usuários.

  • In Amazon Cognito:

    • Crie um novo pool de usuários ou use um existente.

    • Nas configurações App client, defina a URL de redirecionamento para https://yourRancherHostURL/verify-auth. Substitua yourRancherHostURL pelo nome do host real da sua instância do Rancher (por exemplo, https://rancher.example.com/verify-auth).

Configurando o Amazon Cognito no Rancher

  1. No canto superior esquerdo da interface do Rancher, clique em ☰ > Usuários e Autenticação.

  2. Na barra de navegação à esquerda, clique em Provedor de Autenticação.

  3. Select Amazon Cognito.

  4. Preencha o formulário Configurar uma conta do Amazon Cognito. Para ajuda com o preenchimento do formulário, consulte a referência de configuração.

  5. Clique em Habilitar.

    O Rancher redireciona você para a página de login do Amazon Cognito. Insira suas credenciais do Amazon Cognito para validar sua configuração do Rancher.

    Você pode precisar desativar o bloqueador de pop-ups para ver a página de login do Amazon Cognito.

Resultado: O Rancher está configurado para funcionar com seu Amazon Cognito usando o protocolo OIDC. Seus usuários agora podem fazer login no Rancher usando suas credenciais do Amazon Cognito.

A pesquisa de usuários e grupos não é suportada para o Amazon Cognito. Ao atribuir permissões a um Projeto ou Cluster, você deve inserir manualmente o UserID gerado pelo Cognito se o usuário ainda não tiver feito login no Rancher. No entanto, se o usuário já tiver feito login anteriormente, você pode atribuir permissões usando seu nome de usuário ou endereço de e-mail.

Referência de configuração

Campo Descrição

ID do cliente

O Client ID do seu App Client do Amazon Cognito.

Segredo do Cliente

O Segredo gerado do App Client do Amazon Cognito.

Emissor

A URL do emissor do seu App Client do Amazon Cognito. Segue o formato https://cognito-idp.{region}.amazonaws.com/{userPoolId}, e pode ser encontrado na página de configurações do App Client. O Rancher usa a URL do Emissor para buscar todas as URLs necessárias.

Suporte OIDC para Extensão 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.

Solução de problemas

Você não é redirecionado para seu provedor de autenticação

Se você preencher o formulário Configurar uma conta do Amazon Cognito e clicar em Habilitar, e não for redirecionado para o Amazon Cognito, verifique sua configuração do Amazon Cognito.

Configurando o logout ú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'