Externe Authentifizierung aktivieren

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

Voraussetzungen

  • Sie benötigen eine Installation von Apigee Edge für Private Cloud 4.18.05.
  • Zum Ausführen dieser Installation benötigen Sie globale Anmeldedaten als Systemadministrator für Apigee Edge for Private Cloud.
  • Sie müssen das Stammverzeichnis Ihrer Installation von Apigee Edge for Private Cloud kennen. Das Standardstammverzeichnis ist /opt.
  • Sie müssen Ihre Global Edge-Systemadministratoranmeldedaten dem externen LDAP hinzufügen. Denken Sie daran, dass die Sysadmin-Anmeldedaten standardmäßig im internen Edge-LDAP gespeichert werden. Sobald Sie zum externen LDAP-Server wechseln, werden Ihre Systemadministrator-Anmeldedaten 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 für Private Cloud mit den folgenden globalen Anmeldedaten für Systemadministrator 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 Verwaltungsserver-Cluster ausführen, müssen Sie alle Schritte in diesem Dokument für jeden Verwaltungsserver ausführen.

Externe Authentifizierung konfigurieren

Die Hauptaktivität ist die Konfiguration der Datei management-server.properties. Zu diesen Aktivitäten gehören das Beenden und Starten des Edge-Management-Servers, die Entscheidung, ob Sie direkte oder indirekte Bindung verwenden möchten, das Verschlüsseln vertraulicher Anmeldedaten und andere verwandte Aufgaben.

  1. Wichtig: Entscheiden Sie jetzt, ob Sie die Authentifizierungsmethode für indirekte oder direkte Bindungen 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 Management-Server 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 die folgende Zeile hinzu:
    conf_security_authentication.user.store=externalized.authentication

    Diese Zeile fügt das externe Authentifizierungsfeature Ihrer Edge für die Private Cloud-Installation hinzu.

  5. Zur Vereinfachung dieses Schritts haben wir zwei gut kommentierte Beispielkonfigurationen erstellt - eine für die direkte und eine für die indirekte Bindungsauthentifizierung. In den folgenden Beispielen sehen Sie die Bindung, die Sie verwenden möchten, und schließen 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: Unter den folgenden Bedingungen 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 Systemadministrator ebenfalls mit einem Nutzernamen authentifizieren.

      UND/ODER

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

Konfigurationsbeispiel für 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}

Konfigurationsbeispiel für INDIREKTE BINDUNG

## 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 einen Satz globaler Apigee Edge-Systemadministratoranmeldedaten an. Der API-Aufruf, den wir testen, kann nur von einem Edge-Sysadmin 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 Status 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.