Włączanie uwierzytelniania zewnętrznego

W tej sekcji opisujemy, jak uzyskać, zainstalować i skonfigurować komponenty wymagane do zintegrowania usługi LDAP z Apigee Edge na potrzeby uwierzytelniania użytkowników.

Wymagania wstępne

  • Musisz mieć zainstalowaną usługę Apigee Edge dla chmury prywatnej w wersji 4.18.05.
  • Aby przeprowadzić tę instalację, musisz mieć dane logowania globalnego administratora systemu w Apigee Edge dla chmury prywatnej.
  • Musisz znać katalog główny instalacji Apigee Edge dla chmury prywatnej. Domyślny katalog główny to /opt.
  • Musisz dodać dane logowania globalnego administratora systemu Edge do zewnętrznego serwera LDAP. Pamiętaj, że domyślnie dane logowania administratora systemu są przechowywane w wewnętrznym katalogu LDAP Edge. Gdy przełączysz się na zewnętrzny serwer LDAP, dane logowania administratora systemu będą uwierzytelniane na tym serwerze. Dlatego musisz udostępnić dane logowania systemowi zewnętrznemu, zanim włączysz uwierzytelnianie zewnętrzne w Edge.

    Jeśli na przykład masz skonfigurowaną i zainstalowaną usługę Apigee Edge dla chmury prywatnej z globalnymi danymi logowania administratora systemu:

    username: edgeuser@mydomain.com
    password: Secret123

    W takim przypadku użytkownik edgeuser@mydomain.com z hasłem Secret123 musi też znajdować się w zewnętrznym katalogu LDAP.

  • Jeśli używasz klastra serwerów zarządzania, pamiętaj, że musisz wykonać wszystkie czynności opisane w tym dokumencie na każdym serwerze zarządzania.

Konfigurowanie uwierzytelniania zewnętrznego

Główną czynnością, którą wykonasz, będzie skonfigurowanie pliku management-server.properties. Obejmuje to zatrzymywanie i uruchamianie serwera zarządzania Edge, decydowanie, czy chcesz używać wiązania bezpośredniego czy pośredniego, szyfrowanie poufnych danych logowania i inne powiązane zadania.

  1. Ważne: zdecyduj teraz, czy chcesz używać metody uwierzytelniania z powiązaniem pośrednim czy bezpośrednim. Ta decyzja wpłynie na niektóre aspekty konfiguracji. Zapoznaj się z artykułem Uwierzytelnianie zewnętrzne.
  2. Ważne: te czynności konfiguracyjne musisz wykonać na każdym serwerze zarządzania Apigee Edge (jeśli masz ich więcej niż 1).
  3. Otwórz plik /opt/apigee/customer/application/management-server.properties w edytorze tekstu. Jeśli plik nie istnieje, utwórz go.
  4. Dodaj ten wiersz:
    conf_security_authentication.user.store=externalized.authentication

    Ten wiersz dodaje funkcję uwierzytelniania zewnętrznego do instalacji Edge dla chmury prywatnej.

  5. Aby ułatwić ten krok, utworzyliśmy 2 dobrze skomentowane przykładowe konfiguracje – jedną dla uwierzytelniania z powiązaniem bezpośrednim i jedną dla uwierzytelniania z powiązaniem pośrednim. Zapoznaj się z poniższymi przykładami powiązań, których chcesz użyć, i dokończ konfigurację:
  6. Ponownie uruchom serwer zarządzania:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. Sprawdź, czy serwer działa:
    /opt/apigee/apigee-service/bin/apigee-all status
  8. Ważne: musisz przeprowadzić dodatkową konfigurację, jeśli zachodzi co najmniej jedna z tych okoliczności:
    1. Jeśli chcesz, aby użytkownicy logowali się przy użyciu nazw użytkowników, które nie są adresami e-mail. W takim przypadku użytkownik sysadmin musi też uwierzytelnić się za pomocą nazwy użytkownika.

      AND/OR

    2. Jeśli hasło do konta użytkownika sysadmin w zewnętrznym katalogu LDAP różni się od hasła skonfigurowanego podczas pierwszej instalacji Apigee Edge dla chmury prywatnej. Zobacz Konfiguracja wymagana w przypadku różnych danych logowania administratora systemu.

Przykładowa konfiguracja 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}

Przykładowa konfiguracja WIĄZANIA POŚREDNIEGO

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

Testowanie instalacji

  1. Sprawdź, czy serwer działa:
    /opt/apigee/apigee-service/bin/apigee-all status
  2. Wykonaj to polecenie, podając zestaw danych logowania administratora systemu globalnego Apigee Edge. Wywołanie interfejsu API, które będziemy testować, może wykonać tylko administrator systemu Edge.
    curl -v http://management-server-IP:8080/v1/o -u sysadmin_username

    Na przykład:

    curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. Gdy pojawi się prośba, wpisz hasło.

    Jeśli polecenie zwraca stan 200 i listę organizacji, konfiguracja jest prawidłowa. To polecenie sprawdza, czy wywołanie interfejsu API do serwera zarządzania Edge zostało pomyślnie uwierzytelnione przez zewnętrzny system LDAP.