Activer l'authentification externe

Edge for Private Cloud v4.19.01

Cette section explique comment obtenir, installer et configurer les composants requis pour intégrer un service LDAP dans Apigee Edge pour l'authentification des utilisateurs.

Conditions préalables

  • Vous devez disposer d'une installation d'Apigee Edge pour Private Cloud 4.18.05.
  • Vous devez disposer d'identifiants d'administrateur système globaux sur Apigee Edge pour Private Cloud pour effectuer cette installation.
  • Vous devez connaître le répertoire racine de votre installation Apigee Edge for Private Cloud. Le répertoire racine par défaut est /opt.
  • Vous devez ajouter vos identifiants d'administrateur système global Edge au LDAP externe. N'oubliez pas que par défaut, les identifiants d'administrateur système sont stockés dans le LDAP interne d'Edge. Une fois que vous passerez au protocole LDAP externe, vos identifiants d'administrateur système y seront authentifiés. Par conséquent, vous devez provisionner les identifiants sur le système externe avant d'activer l'authentification externe dans Edge.

    Par exemple, si vous avez configuré et installé Apigee Edge pour Private Cloud avec les identifiants d'administrateur système global:

    username: edgeuser@mydomain.com
    password: Secret123

    Dans ce cas, l'utilisateur edgeuser@mydomain.com avec le mot de passe Secret123 doit également être présent dans le LDAP externe.

  • Si vous exécutez un cluster de serveur de gestion, vous devez suivre toutes les étapes décrites dans ce document pour chaque serveur de gestion.

Configurer l'authentification externe

L'activité principale est de configurer le fichier management-server.properties. Cette activité comprend l'arrêt et le démarrage du serveur de gestion Edge, la décision d'utiliser la liaison directe ou indirecte, le chiffrement des identifiants sensibles et d'autres tâches connexes.

  1. Important: Décidez dès maintenant si vous avez l'intention d'utiliser la méthode d'authentification par liaison directe ou indirecte. Cette décision aura une incidence sur certains aspects de la configuration. Consultez la page Authentification externe.
  2. Important: Vous devez suivre ces étapes de configuration sur chaque serveur de gestion Apigee Edge (si vous en exécutez plusieurs).
  3. Ouvrez /opt/apigee/customer/application/management-server.properties dans un éditeur de texte. Si le fichier n'existe pas, créez-le.
  4. Ajoutez la ligne suivante :
    conf_security_authentication.user.store=externalized.authentication

    Cette ligne ajoute la fonctionnalité d'authentification externe à votre installation Edge for Private Cloud.

  5. Pour faciliter cette étape, nous avons créé deux exemples de configuration très recommandés : l'un pour l'authentification par liaison directe et l'autre pour l'authentification par liaison indirecte. Consultez les exemples ci-dessous correspondant à la liaison que vous souhaitez utiliser, puis terminez la configuration :
  6. Redémarrez le serveur de gestion :
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. Vérifiez que le serveur est en cours d'exécution :
    /opt/apigee/apigee-service/bin/apigee-all status
  8. Important: Vous devez effectuer une configuration supplémentaire dans l'une des circonstances suivantes (ou les deux) :
    1. Si vous souhaitez que les utilisateurs se connectent à l'aide de noms d'utilisateur autres que des adresses e-mail. Dans ce cas, votre administrateur système doit également s'authentifier avec un nom d'utilisateur.

      ET/OU

    2. Si le mot de passe de votre compte utilisateur "sysadmin" dans votre serveur LDAP externe est différent de celui que vous avez configuré lors de la première installation d'Apigee Edge pour le cloud privé. Reportez-vous à la section Configuration requise pour différents identifiants d'administrateur système.

Exemple de configuration de liaison directe

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

Exemple de configuration de LIGNE INDIRECTE

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

Tester l'installation

  1. Vérifiez que le serveur est en cours d'exécution :
    /opt/apigee/apigee-service/bin/apigee-all status
  2. Exécutez cette commande en fournissant un ensemble d'identifiants d'administrateur système global Apigee Edge. L'appel d'API que nous allons tester ne peut être exécuté que par un administrateur système Edge.
    curl -v http://management-server-IP:8080/v1/o -u sysadmin_username

    Exemple :

    curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. Saisissez votre mot de passe lorsque vous y êtes invité.

    Si la commande renvoie l'état 200 et la liste des organisations, la configuration est correcte. Cette commande vérifie que l'appel d'API au serveur de gestion Edge a bien été authentifié via le système LDAP externe.