Como ativar a autenticação externa

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 de usuários.

Pré-requisitos

  • Você precisa ter uma instalação do Apigee Edge para nuvem privada 4.18.05.
  • É preciso ter credenciais de administrador do sistema global na Apigee Edge para nuvem privada para realizar essa instalação.
  • Você precisa saber o diretório raiz da instalação do Apigee Edge para nuvem privada. O diretório raiz padrão é /opt.
  • É necessário adicionar suas credenciais de administrador do sistema global do Edge ao LDAP externo. Por padrão, as credenciais do sysadmin são armazenadas no LDAP interno do Edge. Depois que você mudar para o LDAP externo, suas credenciais de sysadmin serão autenticadas nele. Portanto, é necessário provisionar as credenciais para o sistema externo antes de ativar a autenticação externa no Edge.

    Por exemplo, se você tiver configurado e instalado o Apigee Edge para nuvem privada com credenciais globais de administrador do sistema 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 Management Server, será necessário executar todas as etapas neste documento para cada Management Server.

Como configurar a autenticação externa

A principal atividade que você vai realizar é configurar o arquivo management-server.properties. Essa atividade inclui interromper e iniciar o servidor de gerenciamento do Edge, decidir se você quer usar a 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 vai afetar alguns aspectos da configuração. Consulte Autenticação externa.
  2. Importante: é preciso seguir estas etapas de configuração em cada servidor de gerenciamento da Apigee Edge (se você 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 linha abaixo:
    conf_security_authentication.user.store=externalized.authentication

    Essa linha adiciona o recurso de autenticação externa à instalação do Edge para nuvem privada.

  5. Para facilitar essa etapa, criamos duas configurações de amostra bem comentadas: uma para autenticação de vinculação direta e outra para indireta. Confira 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 extra em uma (ou ambas) das seguintes circunstâncias:
    1. Se você quiser que os usuários façam login usando nomes de usuário que não são endereços de e-mail. Nesse caso, o usuário sysadmin também precisa se autenticar com um nome de usuário.

      E/OU

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

Exemplo de configuração de VINCULAÇÃO DIRETA

## 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}

Exemplo de configuração de INDIRECT BINDING

## 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

Como testar 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 da Apigee Edge. A chamada de API que vamos testar só pode ser executada por um sysadmin 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. Insira sua senha quando solicitado.

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