Externe Authentifizierung aktivieren

In diesem Abschnitt wird erläutert, wie Sie die Komponenten abrufen, installieren und konfigurieren, die für die Einbindung eines LDAP-Dienstes in Apigee Edge zur Nutzerauthentifizierung erforderlich sind.

Vorbereitung

  • Sie müssen eine Apigee Edge for Private Cloud 4.18.05-Installation haben.
  • Sie benötigen globale Systemadministrator-Anmeldedaten für Apigee Edge for Private Cloud, um diese Installation auszuführen.
  • Sie müssen das Stammverzeichnis Ihrer Apigee Edge for Private Cloud-Installation kennen. Das Standardstammverzeichnis ist /opt.
  • Sie müssen Ihre Anmeldedaten als globaler Edge-Systemadministrator dem externen LDAP hinzufügen. Standardmäßig werden die Anmeldedaten des Systemadministrators im internen LDAP von Edge gespeichert. Sobald Sie zum externen LDAP wechseln, werden Ihre Sysadmin-Anmeldedaten stattdessen dort authentifiziert. Daher müssen Sie die Anmeldedaten für das externe System bereitstellen, bevor Sie die externe Authentifizierung in Edge aktivieren.

    Wenn Sie beispielsweise Apigee Edge for Private Cloud mit globalen Systemadministrator-Anmeldedaten konfiguriert und installiert haben:

    username: edgeuser@mydomain.com
    password: Secret123

    Dann muss der Nutzer edgeuser@mydomain.com mit dem Passwort Secret123 auch im externen LDAP vorhanden sein.

  • Wenn Sie einen Management Server-Cluster ausführen, müssen Sie alle Schritte in diesem Dokument für jeden Management Server ausführen.

Externe Authentifizierung konfigurieren

Die Hauptaufgabe besteht darin, die Datei management-server.properties zu konfigurieren. Dazu gehören das Beenden und Starten des Edge Management Servers, die Entscheidung, ob Sie eine direkte oder indirekte Bindung verwenden möchten, das Verschlüsseln sensibler Anmeldedaten und andere zugehörige Aufgaben.

  1. Wichtig: Entscheiden Sie jetzt, ob Sie die Authentifizierungsmethode mit indirekter oder direkter Bindung verwenden möchten. Diese Entscheidung wirkt sich auf einige Aspekte der Konfiguration aus. Siehe Externe Authentifizierung.
  2. Wichtig: Sie müssen diese Konfigurationsschritte auf jedem Apigee Edge-Verwaltungsserver ausführen, wenn Sie mehr als einen ausführen.
  3. Öffnen Sie /opt/apigee/customer/application/management-server.properties in einem Texteditor. Wenn die Datei nicht vorhanden ist, erstellen Sie sie.
  4. Fügen Sie folgende Zeile hinzu:
    conf_security_authentication.user.store=externalized.authentication

    Mit dieser Zeile wird die Funktion für die externe Authentifizierung zu Ihrer Edge for Private Cloud-Installation hinzugefügt.

  5. Um diesen Schritt zu vereinfachen, haben wir zwei gut kommentierte Beispielkonfigurationen erstellt – eine für die direkte und eine für die indirekte Bindungsauthentifizierung. Sehen Sie sich die folgenden Beispiele für die gewünschte Bindung an und schließen Sie die Konfiguration ab:
  6. Starten Sie den Verwaltungsserver neu:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. Prüfen Sie, ob der Server ausgeführt wird:
    /opt/apigee/apigee-service/bin/apigee-all status
  8. Wichtig: In den folgenden Fällen müssen Sie eine zusätzliche Konfiguration vornehmen:
    1. Wenn Sie möchten, dass sich Nutzer mit Nutzernamen anmelden, die keine E-Mail-Adressen sind. In diesem Fall muss sich Ihr sysadmin-Nutzer auch mit einem Nutzernamen authentifizieren.

      UND/ODER

    2. Wenn das Passwort für Ihr sysadmin-Nutzerkonto in Ihrem externen LDAP sich von dem Passwort unterscheidet, das Sie bei der Erstinstallation von Apigee Edge for Private Cloud konfiguriert haben. Weitere Informationen finden Sie unter Erforderliche Konfiguration für verschiedene Sysadmin-Anmeldedaten.

Konfigurationsbeispiel für DIREKTE BINDUNG

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

Beispiel für die Konfiguration von 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

Installation testen

  1. Prüfen Sie, ob der Server ausgeführt wird:
    /opt/apigee/apigee-service/bin/apigee-all status
  2. Führen Sie diesen Befehl aus und geben Sie dabei Anmeldedaten für den globalen Systemadministrator von Apigee Edge an. Der API-Aufruf, den wir testen, kann nur von einem Edge-Systemadministrator ausgeführt werden.
    curl -v http://management-server-IP:8080/v1/o -u sysadmin_username

    Beispiel:

    curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. Geben Sie Ihr Passwort ein, wenn Sie dazu aufgefordert werden.

    Wenn der Befehl den Statuscode 200 und eine Liste von Organisationen zurückgibt, ist die Konfiguration korrekt. Mit diesem Befehl wird geprüft, ob der API-Aufruf an den Edge Management Server erfolgreich über das externe LDAP-System authentifiziert wurde.