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

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

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

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

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

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

    ชื่อผู้ใช้: edgeuser@mydomain.com
    รหัสผ่าน: 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 ตัวอย่าง โดยการกำหนดค่าหนึ่งสำหรับการตรวจสอบสิทธิ์แบบเชื่อมโยงโดยตรงและอีกตัวอย่างสำหรับการตรวจสอบสิทธิ์ที่มีผลผูกพันทางอ้อม ดูตัวอย่างการเชื่อมโยงที่ต้องการใช้ แล้วกำหนดค่าให้เสร็จสมบูรณ์ที่ด้านล่าง

    ตัวอย่างการกำหนดค่าการเชื่อมโยง DIRECT
    ตัวอย่างการกำหนดค่าการเชื่อมโยงทางอ้อม
  6. รีสตาร์ทเซิร์ฟเวอร์การจัดการโดยทำดังนี้
    > /opt/apigee/apigee-service/bin/apigee-service edge-management-serverบ้างไหม
  7. ยืนยันว่าเซิร์ฟเวอร์ทำงานอยู่
    > /opt/apigee/apigee-service/bin/apigee-all status
  8. สำคัญ: คุณต้องดำเนินการกำหนดค่าเพิ่มเติมภายใต้สถานการณ์ใดกรณีหนึ่งต่อไปนี้ (หรือทั้ง 2 อย่าง) (ก) หากคุณตั้งใจให้ผู้ใช้ลงชื่อเข้าสู่ระบบโดยใช้ชื่อผู้ใช้ที่ไม่ใช่อีเมล ในกรณีนี้ ผู้ใช้ Sysadmin ต้องตรวจสอบสิทธิ์ด้วยชื่อผู้ใช้ และ/หรือ (ข) หากรหัสผ่านสำหรับบัญชีผู้ใช้ Syadmin ใน 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, 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:
conf_security_externalized.authentication.user.store.user.attribute=userPrincipalName

## The LDAP attribute where the user email value is stored. For direct binding, 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 เท่านั้น

    สำคัญ: บัญชี LDAP ภายนอกของคุณต้องมีข้อมูลเข้าสู่ระบบที่เหมือนกัน หากไม่มี คุณต้องเพิ่มที่อยู่ตอนนี้ก่อน โปรดทราบว่าโดยปกติแล้วชื่อผู้ใช้จะเป็นอีเมล แต่ก็ขึ้นอยู่กับวิธีที่คุณกำหนดค่าการตรวจสอบสิทธิ์ภายนอกตามที่อธิบายไว้ก่อนหน้านี้ในเอกสารนี้
    > curl -v http://<management-server-ip>:8080/v1/o -u <Sysadmin Username>

    เช่น
    > curl -v http://192.168.52.100:8080/uv1/mydomaino
  3. ป้อนรหัสผ่านเมื่อมีข้อความแจ้ง

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