Esta seção explica como adquirir, instalar e configurar os componentes necessários para integrar um serviço LDAP ao Apigee Edge para a autenticação de usuários.
Pré-requisitos
- Você precisa ter o 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 nuvem privada para faça a instalação.
- Você precisa saber o diretório raiz do Apigee Edge para instalação de nuvem privada. A
      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 Edge,
      LDAP interno. Depois de mudar para o LDAP externo, suas credenciais do sysadmin
      serão autenticados lá. Portanto, você deve 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 de administrador do sistema como: username: edgeuser@mydomain.com password: Secret123 Depois, o usuário edgeuser@mydomain.comcom a senha OSecret123também precisa estar presente no LDAP externo.
- Se você estiver executando um cluster do servidor de gerenciamento, observe que é necessário seguir todas as etapas neste 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 Edge Management Server, decidir se você
  quiser usar vinculação direta ou indireta, criptografia de credenciais confidenciais e outras
  tarefas.
- Importante: decida se você pretende usar a abordagem indireta ou direta método de autenticação de vinculação. Essa decisão vai afetar alguns aspectos da configuração. Consulte Autenticação externa.
- Importante: você precisa seguir estas etapas de configuração em cada gerenciamento do Apigee Edge Server (se estiver executando mais de um).
- Abrir /opt/apigee/customer/application/management-server.propertiesem um editor de texto. Crie o arquivo se ele não existir.
- Adicione a seguinte linha:
      conf_security_authentication.user.store=externalized.authentication Esta linha adiciona o recurso de autenticação externa ao Edge para nuvem privada e instalação. 
- 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. Confira os exemplos abaixo para a vinculação que você quer usar e conclua a configuração:
- Reinicie o servidor de gerenciamento:
      /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart 
- Verifique se o servidor está em execução:
      /opt/apigee/apigee-service/bin/apigee-all status 
- Importante: é necessário fazer uma configuração adicional em um (ou ambos)
      das seguintes circunstâncias:
      - Se você pretende que os usuários façam login com nomes de usuário
          e não endereços de e-mail. Nesse caso, o usuário sysadmin também deve se autenticar com uma
          nome de usuário
          E/OU 
- Se a senha da sua conta de usuário sysadmin no diretório O LDAP é diferente da senha que você configurou quando instalou o Apigee Edge pela primeira vez para de nuvem privada virtual. Consulte Configuração necessária para diferentes credenciais do sysadmin.
 
- Se você pretende que os usuários façam login com nomes de usuário
          e não endereços de e-mail. Nesse caso, o usuário sysadmin também deve se autenticar com uma
          nome de usuário
          
VINCULAÇÃO DIRETA exemplo de configuração
## 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 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
Como testar a instalação
- Verifique se o servidor está em execução:
      /opt/apigee/apigee-service/bin/apigee-all status 
- Execute este comando, fornecendo um conjunto de administradores do sistema global do Apigee Edge
      credenciais. A chamada de API que vamos testar só pode ser executada por um Edge
      sysadmin.
      
      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 
- Digite 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 de borda foi realizada com sucesso autenticados por meio do sistema LDAP externo.