การเปิดใช้การตรวจสอบสิทธิ์ภายนอก

Edge สำหรับ Private Cloud เวอร์ชัน 4.19.01

ส่วนนี้อธิบายวิธีรับ ติดตั้ง และกำหนดค่าคอมโพเนนต์ที่จำเป็นในการผสานรวมบริการ LDAP เข้ากับ Apigee Edge สำหรับการตรวจสอบสิทธิ์ผู้ใช้

ข้อกำหนดเบื้องต้น

  • คุณต้องมี Apigee Edge สำหรับการติดตั้ง Private Cloud 4.18.05
  • คุณต้องมีข้อมูลเข้าสู่ระบบของผู้ดูแลระบบส่วนกลางบน Apigee Edge สำหรับ Private Cloud เพื่อดำเนินการติดตั้งนี้
  • คุณจำเป็นต้องทราบไดเรกทอรีรากของการติดตั้ง Apigee Edge สำหรับ Private Cloud ไดเรกทอรีรากเริ่มต้นคือ /opt
  • คุณต้องเพิ่มข้อมูลเข้าสู่ระบบของผู้ดูแลระบบส่วนกลาง Edge ไปยัง LDAP ภายนอก โปรดทราบว่าโดยค่าเริ่มต้น ข้อมูลเข้าสู่ระบบของผู้ดูแลระบบจะเก็บไว้ใน LDAP ภายในของ Edge เมื่อคุณเปลี่ยนไปใช้ LDAP ภายนอก ระบบจะตรวจสอบสิทธิ์ข้อมูลเข้าสู่ระบบของ sysadmin จากที่นั่นแทน ดังนั้น คุณต้องจัดสรรข้อมูลเข้าสู่ระบบให้กับระบบภายนอกก่อนเปิดใช้การตรวจสอบสิทธิ์ภายนอกใน Edge

    ตัวอย่างเช่น หากคุณกำหนดค่าและติดตั้ง Apigee Edge สำหรับ Private Cloud ด้วยข้อมูลเข้าสู่ระบบของผู้ดูแลระบบส่วนกลางดังนี้

    username: edgeuser@mydomain.com
    password: Secret123

    จากนั้นต้องมีผู้ใช้ edgeuser@mydomain.com ที่มีรหัสผ่าน Secret123 ใน LDAP ภายนอกด้วย

  • หากเรียกใช้คลัสเตอร์เซิร์ฟเวอร์การจัดการอยู่ โปรดทราบว่าคุณต้องทำตามขั้นตอนทั้งหมดในเอกสารนี้สำหรับเซิร์ฟเวอร์การจัดการแต่ละเครื่อง

การกำหนดค่าการตรวจสอบสิทธิ์ภายนอก

กิจกรรมหลักที่คุณจะทำคือการกำหนดค่าไฟล์ management-server.properties กิจกรรมนี้รวมถึงการหยุดและเริ่มต้น Edge Management Server, การตัดสินใจว่าคุณต้องการใช้การเชื่อมโยงโดยตรงหรือโดยอ้อม, การเข้ารหัสข้อมูลเข้าสู่ระบบที่มีความละเอียดอ่อน และงานอื่นๆ ที่เกี่ยวข้อง

  1. สำคัญ: เลือกเลยว่าคุณตั้งใจจะใช้วิธีการตรวจสอบสิทธิ์การเชื่อมโยงโดยอ้อมหรือโดยตรง การตัดสินใจนี้จะมีผลต่อการกำหนดค่าบางส่วน ดูการตรวจสอบสิทธิ์ภายนอก
  2. ข้อสำคัญ: คุณต้องทำตามขั้นตอนการกำหนดค่าเหล่านี้ในเซิร์ฟเวอร์การจัดการ Apigee Edge แต่ละรายการ (หากคุณใช้มากกว่า 1 เซิร์ฟเวอร์)
  3. เปิด /opt/apigee/customer/application/management-server.properties ในเครื่องมือแก้ไขข้อความ หากไม่มีไฟล์ ให้สร้างขึ้นมา
  4. เพิ่มบรรทัดต่อไปนี้
    conf_security_authentication.user.store=externalized.authentication

    บรรทัดนี้เพิ่มฟีเจอร์การตรวจสอบสิทธิ์ภายนอกลงใน Edge สำหรับการติดตั้ง Private Cloud

  5. เพื่อให้ขั้นตอนนี้ง่ายขึ้น เราได้สร้างตัวอย่างการกำหนดค่าที่เป็นประโยชน์ 2 ตัวอย่าง โดยการกำหนดค่าหนึ่งสำหรับการตรวจสอบสิทธิ์แบบเชื่อมโยงโดยตรงและอีกตัวอย่างสำหรับการตรวจสอบสิทธิ์ที่มีผลผูกพันทางอ้อม ดูตัวอย่างการเชื่อมโยงที่ต้องการใช้ แล้วกำหนดค่าให้เสร็จสมบูรณ์ที่ด้านล่าง
  6. รีสตาร์ทเซิร์ฟเวอร์การจัดการโดยทำดังนี้
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. ยืนยันว่าเซิร์ฟเวอร์กำลังทำงานอยู่ โดยทำดังนี้
    /opt/apigee/apigee-service/bin/apigee-all status
  8. สำคัญ: คุณต้องทำการกำหนดค่าเพิ่มเติมภายใต้สถานการณ์ใดกรณีหนึ่งต่อไปนี้ (หรือทั้ง 2 อย่าง)
    1. หากคุณต้องการให้ผู้ใช้ลงชื่อเข้าสู่ระบบโดยใช้ชื่อผู้ใช้ที่ไม่ใช่อีเมล ในกรณีนี้ ผู้ใช้ sysadmin ต้องตรวจสอบสิทธิ์ด้วยชื่อผู้ใช้ด้วย

      และ/หรือ

    2. หากรหัสผ่านสำหรับบัญชีผู้ใช้ผู้ดูแลระบบใน LDAP ภายนอกแตกต่างจากรหัสผ่านที่คุณกำหนดค่าไว้ตอนติดตั้ง Apigee Edge สำหรับ Private Cloud เป็นครั้งแรก โปรดดูต้องมีการกำหนดค่าสำหรับข้อมูลเข้าสู่ระบบของผู้ดูแลระบบที่แตกต่างกัน

ตัวอย่างการกำหนดค่า 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}

ตัวอย่างการกำหนดค่าการเชื่อมโยงทางอ้อม

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

การทดสอบการติดตั้ง

  1. ยืนยันว่าเซิร์ฟเวอร์กำลังทำงานอยู่ โดยทำดังนี้
    /opt/apigee/apigee-service/bin/apigee-all status
  2. ใช้คำสั่งนี้เพื่อระบุชุดข้อมูลเข้าสู่ระบบของผู้ดูแลระบบส่วนกลาง Apigee Edge การเรียก API ที่เรากำลังจะทดสอบต้องดำเนินการโดยผู้ดูแลระบบ Edge เท่านั้น
    curl -v http://management-server-IP:8080/v1/o -u sysadmin_username

    เช่น

    curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. ป้อนรหัสผ่านเมื่อมีข้อความแจ้ง

    ถ้าคำสั่งแสดงสถานะ 200 และรายชื่อองค์กรกลับมา แสดงว่าการกำหนดค่าถูกต้อง คำสั่งนี้จะยืนยันว่าการเรียก API ไปยังเซิร์ฟเวอร์การจัดการ Edge ผ่านระบบ LDAP ภายนอกเรียบร้อยแล้ว