Bật xác thực bên ngoài

Edge cho đám mây riêng tư phiên bản 4.19.01

Phần này giải thích cách lấy, cài đặt và định cấu hình các thành phần cần thiết để tích hợp dịch vụ LDAP vào Apigee Edge để xác thực người dùng.

Điều kiện tiên quyết

  • Bạn phải cài đặt Apigee Edge for Private Cloud 4.18.05.
  • Bạn phải có thông tin xác thực quản trị viên hệ thống toàn cầu trên Apigee Edge dành cho đám mây riêng tư thì mới có thể cài đặt.
  • Bạn cần biết thư mục gốc của Apigee Edge để cài đặt đám mây riêng tư. Thư mục gốc mặc định là /opt.
  • Bạn phải thêm Thông tin xác thực quản trị viên hệ thống toàn cầu Edge vào LDAP bên ngoài. Hãy nhớ rằng theo mặc định, thông tin xác thực quản trị viên hệ thống sẽ được lưu trữ trong LDAP nội bộ của Edge. Sau khi bạn chuyển sang LDAP bên ngoài, thông tin đăng nhập quản trị viên hệ thống của bạn sẽ được xác thực ở đó. Do đó, bạn phải cung cấp thông tin xác thực cho hệ thống bên ngoài trước khi bật tính năng xác thực bên ngoài trong Edge.

    Ví dụ: Nếu bạn đã định cấu hình và cài đặt Apigee Edge cho đám mây riêng tư bằng thông tin xác thực của quản trị viên hệ thống toàn cầu như:

    username: edgeuser@mydomain.com
    password: Secret123

    Sau đó, người dùng edgeuser@mydomain.com có mật khẩu Secret123 cũng phải có trong LDAP bên ngoài.

  • Nếu đang chạy cụm Máy chủ quản lý, xin lưu ý rằng bạn phải thực hiện tất cả các bước trong tài liệu này cho từng Máy chủ quản lý.

Định cấu hình phương thức xác thực bên ngoài

Hoạt động chính bạn sẽ thực hiện là định cấu hình tệp management-server.properties. Hoạt động này bao gồm việc dừng và khởi động Máy chủ quản lý biên, quyết định xem bạn muốn sử dụng liên kết trực tiếp hay gián tiếp, mã hoá thông tin xác thực nhạy cảm và các tác vụ khác có liên quan.

  1. Lưu ý quan trọng: Hãy quyết định ngay bây giờ bạn định sử dụng phương thức xác thực liên kết gián tiếp hay trực tiếp. Quyết định này sẽ ảnh hưởng đến một số khía cạnh của cấu hình. Xem phần Xác thực bên ngoài.
  2. Lưu ý quan trọng: Bạn phải thực hiện các bước định cấu hình sau đây trên từng Máy chủ quản lý Apigee Edge (nếu bạn đang chạy nhiều máy chủ).
  3. Mở /opt/apigee/customer/application/management-server.properties trong một trình chỉnh sửa văn bản. Hãy tạo tệp nếu chưa có.
  4. Thêm dòng sau:
    conf_security_authentication.user.store=externalized.authentication

    Dòng này sẽ thêm tính năng xác thực bên ngoài vào Edge để cài đặt đám mây riêng tư.

  5. Để giúp bước này trở nên dễ dàng, chúng tôi đã tạo 2 cấu hình mẫu có nhiều nhận xét – một cấu hình cho quy trình xác thực liên kết trực tiếp và một cấu hình cho việc xác thực liên kết gián tiếp. Hãy xem các mẫu bên dưới cho mối liên kết mà bạn muốn sử dụng và hoàn tất cấu hình:
  6. Khởi động lại máy chủ quản lý:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. Xác minh rằng máy chủ đang chạy:
    /opt/apigee/apigee-service/bin/apigee-all status
  8. Lưu ý quan trọng: Bạn phải định cấu hình bổ sung cho một (hoặc cả hai) các trường hợp sau:
    1. Nếu bạn định cho phép người dùng đăng nhập bằng tên người dùng không phải là địa chỉ email. Trong trường hợp này, người dùng sysadmin cũng phải xác thực bằng tên người dùng.

      VÀ/HOẶC

    2. Nếu mật khẩu của tài khoản người dùng quản trị viên hệ thống trong LDAP bên ngoài khác với mật khẩu mà bạn đã định cấu hình khi cài đặt Apigee Edge cho đám mây riêng tư lần đầu. Hãy xem phần Cấu hình cần thiết cho nhiều thông tin xác thực sysadmin.

Mẫu cấu hình LIÊN KẾT TRỰC TIẾP

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

Mẫu cấu hình ROWS 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

Kiểm tra việc cài đặt

  1. Xác minh rằng máy chủ đang chạy:
    /opt/apigee/apigee-service/bin/apigee-all status
  2. Thực thi lệnh này, cung cấp một tập hợp thông tin xác thực quản trị viên hệ thống chung API. Chỉ có quản trị viên hệ thống Edge mới có thể thực thi lệnh gọi API mà chúng ta sẽ kiểm thử.
    curl -v http://management-server-IP:8080/v1/o -u sysadmin_username

    Ví dụ:

    curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. Nhập mật khẩu của bạn khi được nhắc.

    Nếu lệnh này trả về trạng thái 200 và một danh sách các tổ chức, thì cấu hình là chính xác. Lệnh này xác minh rằng lệnh gọi API đến Máy chủ quản lý cạnh đã được xác thực thành công thông qua hệ thống LDAP bên ngoài.