Como ativar a autenticação externa

Edge para nuvem privada v4.19.01

Nesta seção, explicamos como receber, instalar e configurar os componentes necessários para integrar um serviço LDAP ao Apigee Edge para autenticação do usuário.

Pré-requisitos

  • É necessário ter um Apigee Edge para a instalação da nuvem privada 4.18.05.
  • Você precisa ter credenciais de administrador de sistema global no Apigee Edge para a nuvem privada para realizar esta instalação.
  • Você precisa saber o diretório raiz da Apigee Edge para instalação da nuvem privada. O diretório raiz padrão é /opt.
  • Adicione suas credenciais de administrador do sistema global do Edge ao LDAP externo. Lembre-se de que, por padrão, as credenciais sysadmin são armazenadas no LDAP interno do Edge. Depois de alternar para o LDAP externo, as credenciais do sysadmin serão autenticadas lá. Portanto, você precisa provisionar as credenciais para o sistema externo antes de ativar a autenticação externa no Edge.

    Por exemplo, se você configurou e instalou o Apigee Edge para nuvem privada com credenciais de administrador de sistema global como:

    username: edgeuser@mydomain.com
    password: Secret123

    Em seguida, o usuário edgeuser@mydomain.com com a senha Secret123 também precisa estar presente no LDAP externo.

  • Se você estiver executando um cluster do servidor de gerenciamento, conclua todas as etapas deste documento para cada servidor de gerenciamento.

Como configurar a autenticação externa

A principal atividade que você vai realizar é a configuração do arquivo management-server.properties. Essa atividade inclui interromper e iniciar o Servidor de gerenciamento de borda, decidir se você quer usar vinculação direta ou indireta, criptografar credenciais confidenciais e outras tarefas relacionadas.

  1. Importante: decida agora se você pretende usar o método de autenticação de vinculação indireta ou direta. Essa decisão afetará alguns aspectos da configuração. Consulte Autenticação externa.
  2. Importante: você precisará concluir estas etapas de configuração em cada servidor de gerenciamento de borda da Apigee, se estiver executando mais de um.
  3. Abra /opt/apigee/customer/application/management-server.properties em um editor de texto. Se o arquivo não existir, crie-o.
  4. Adicione a seguinte linha:
    conf_security_authentication.user.store=externalized.authentication

    Esta linha adiciona o recurso de autenticação externa ao Edge para instalação da nuvem privada.

  5. Para facilitar essa etapa, criamos duas configurações de exemplo bem comentadas: uma para autenticação de vinculação direta e outra para autenticação de vinculação indireta. Consulte as amostras abaixo para a vinculação que você quer usar e conclua a configuração:
  6. Reinicie o servidor de gerenciamento:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. Verifique se o servidor está em execução:
    /opt/apigee/apigee-service/bin/apigee-all status
  8. Importante: é necessário fazer uma configuração adicional em uma ou em ambas as circunstâncias a seguir:
    1. Se você pretende que os usuários façam login com nomes de usuário que não são endereços de e-mail. Nesse caso, seu usuário do sysadmin também precisa se autenticar com um nome de usuário.

      E/OU

    2. Se a senha da conta de usuário sysadmin no LDAP externo for diferente da senha que você configurou quando instalou o Apigee Edge para nuvem privada pela primeira vez. Consulte Configuração necessária para diferentes credenciais do sysadmin.

Amostra de configuração DIRECT BINDING

## The first property is always required to enable the external authorization feature.
## Do not change it.
conf_security_externalized.authentication.implementation.class=com.apigee.rbac.impl.LdapAuthenticatorImpl

## Identify the type of binding:
## Set to "true" for direct binding
## Set to "false" for indirect binding.
conf_security_externalized.authentication.bind.direct.type=true

## The next seven properties are needed regardless of direct or indirect binding. You need to
## configure these per your external authentication installation.
## The IP or domain for your external LDAP instance. 
conf_security_externalized.authentication.server.url=ldap://localhost:389

## Your external LDAP server version.
conf_security_externalized.authentication.server.version=3

## The server timeout in milliseconds. 
conf_security_externalized.authentication.server.conn.timeout=50000

## Change these baseDN values to match your external LDAP service. This attribute value will be
## provided by your external LDAP administrator, and may have more or fewer dc elements depending
## on your setup.
conf_security_externalized.authentication.user.store.baseDN=dc=apigee,dc=com

## Do not change this search string. It is used internally. 
conf_security_externalized.authentication.user.store.search.query=(&(${userAttribute}=${userId}))

## Identifies the external LDAP property you want to bind against for Authentication. For
## example if you are binding against an email address in Microsoft Active Directory, this would be
## the userPrincipalName property in your external LDAP instance. Alternatively if you are binding
## against the user's ID, this would typically be in the sAMAccountName property:
conf_security_externalized.authentication.user.store.user.attribute=userPrincipalName

## The LDAP attribute where the user email value is stored. For direct binding with AD, set it to
## userPrincipalName.
conf_security_externalized.authentication.user.store.user.email.attribute=userPrincipalName

## ONLY needed for DIRECT binding.
## The direct.bind.user.directDN property defines the string that is used for the bind against the
## external authentication service. Ensure it is set as follows:
conf_security_externalized.authentication.direct.bind.user.directDN=${userDN}

Amostra de configuração de VINCULAÇÃO INDIRETA

## Required to enable the external authorization feature. Do not change it.
conf_security_externalized.authentication.implementation.class=com.apigee.rbac.impl.LdapAuthenticatorImpl

## Identifies the type of binding:
## Set to "true" for direct binding
## Set to "false" for indirect binding.
conf_security_externalized.authentication.bind.direct.type=false

## The next seven properties are needed regardless of direct or indirect binding. You need to
## configure these per your external LDAP installation.
## The IP or domain for your external LDAP instance.
conf_security_externalized.authentication.server.url=ldap://localhost:389

## Replace with your external LDAP server version.
conf_security_externalized.authentication.server.version=3

## Set the server timeout in milliseconds. 
conf_security_externalized.authentication.server.conn.timeout=50000

## Change these baseDN values to match your external LDAP service. This attribute value will be
# provided by your external LDAP administrator, and may have more or fewer dc elements
# depending on your setup.
conf_security_externalized.authentication.user.store.baseDN=dc=apigee,dc=com

## Do not change this search string. It is used internally. 
conf_security_externalized.authentication.user.store.search.query=(&(${userAttribute}=${userId}))

## Identifies the external LDAP property you want to bind against for Authentication. For example
## if you are binding against an email address, this would typically be in the
## userPrincipalName property in your external LDAP instance. Alternatively if you are binding
## against the user's ID, this would typically be in the sAMAccountName property.
## See also "Configuration required for different sysadmin credentials".
conf_security_externalized.authentication.user.store.user.attribute=userPrincipalName

## Used by Apigee to perform the Authorization step and currently, Apigee only supports email
## address for Authorization. Make sure to set it to the attribute in your external LDAP that
## stores the user's email address. Typically this will be in the userPrincipalName property.
conf_security_externalized.authentication.user.store.user.email.attribute=userPrincipalName

## The external LDAP username (for a user with search privileges on the external LDAP) and
## password and whether the password is encrypted. You must also set the attribute
## externalized.authentication.bind.direct.type to false.
## The password attribute can be encrypted or in plain text. See
## "Indirect binding only: Encrypting the external LDAP user's password"
## for encryption instructions. Set the password.encrypted attribute to "true" if the password is
## encrypted. Set it to "false" if the password is in plain text.
conf_security_externalized.authentication.indirect.bind.server.admin.dn=myExtLdapUsername
conf_security_externalized.authentication.indirect.bind.server.admin.password=myExtLdapPassword
conf_security_externalized.authentication.indirect.bind.server.admin.password.encrypted=true

Teste a instalação

  1. Verifique se o servidor está em execução:
    /opt/apigee/apigee-service/bin/apigee-all status
  2. Execute este comando, fornecendo um conjunto de credenciais de administrador do sistema global do Apigee Edge. A chamada de API que testaremos só pode ser executada por um administrador de sistema do Edge.
    curl -v http://management-server-IP:8080/v1/o -u sysadmin_username

    Exemplo:

    curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. Digite sua senha quando solicitado.

    Se o comando retornar um status 200 e uma lista de organizações, a configuração estará correta. Esse comando verifica se a chamada de API para o servidor de gerenciamento de borda foi autenticada pelo sistema LDAP externo.