Edge for Private Cloud เวอร์ชัน 4.17.09
ส่วนนี้จะอธิบายวิธีรับ ติดตั้ง และกำหนดค่าคอมโพเนนต์ที่จำเป็นในการผสานรวมบริการ LDAP ภายนอกเข้ากับ Apigee Edge สำหรับการตรวจสอบสิทธิ์ผู้ใช้
ข้อกำหนดเบื้องต้น
- คุณต้องติดตั้ง Apigee Edge สำหรับ Private Cloud 4.17.09
- คุณต้องมีข้อมูลเข้าสู่ระบบของผู้ดูแลระบบส่วนกลางใน Apigee Edge สำหรับ Private Cloud เพื่อทำการติดตั้งนี้
- คุณจำเป็นต้องทราบไดเรกทอรีรากของ Apigee Edge สำหรับการติดตั้ง Private Cloud ไดเรกทอรีรากเริ่มต้นคือ /opt
- คุณต้องเพิ่มข้อมูลเข้าสู่ระบบของผู้ดูแลระบบ Edge Global System ลงใน LDAP ภายนอก โปรดทราบว่าโดยค่าเริ่มต้น ข้อมูลเข้าสู่ระบบของผู้ดูแลระบบจะจัดเก็บไว้ใน LDAP ภายในของ Edge เมื่อเปลี่ยนไปใช้ LDAP ภายนอก ระบบจะตรวจสอบสิทธิ์ข้อมูลเข้าสู่ระบบของผู้ดูแลระบบที่นั่นแทน ดังนั้น คุณต้องจัดสรรข้อมูลเข้าสู่ระบบให้กับระบบภายนอกก่อนเปิดใช้การตรวจสอบสิทธิ์ภายนอกใน Edge
ตัวอย่างเช่น หากคุณกำหนดค่าและติดตั้ง Apigee Edge สำหรับ Private Cloud ด้วยข้อมูลเข้าสู่ระบบของผู้ดูแลระบบส่วนกลางดังนี้
ชื่อผู้ใช้: edgeuser@mydomain.com
รหัสผ่าน: Secret123
ผู้ใช้ edgeuser@mydomain.com ที่มีรหัสผ่าน Secret123 จะต้องอยู่ใน LDAP ภายนอกด้วย - หากคุณใช้คลัสเตอร์เซิร์ฟเวอร์การจัดการ โปรดทราบว่าคุณต้องทำตามขั้นตอนทั้งหมดในเอกสารนี้สำหรับเซิร์ฟเวอร์การจัดการแต่ละรายการ
การกำหนดค่าการตรวจสอบสิทธิ์ภายนอก
กิจกรรมหลักที่คุณจะทำคือการกำหนดค่าไฟล์ management-server.properties กิจกรรมนี้รวมถึงการหยุดและเริ่ม Edge Management Server, การตัดสินใจว่าคุณต้องการใช้การเชื่อมโยงโดยตรงหรือโดยอ้อม, การเข้ารหัสข้อมูลเข้าสู่ระบบที่ละเอียดอ่อน และงานอื่นๆ ที่เกี่ยวข้อง
- สำคัญ: ตัดสินใจตอนนี้ว่าคุณต้องการใช้วิธีการตรวจสอบสิทธิ์การเชื่อมโยงโดยอ้อมหรือโดยตรง การตัดสินใจนี้จะส่งผลต่อการกำหนดค่าบางด้าน โปรดดูหัวข้อการตรวจสอบสิทธิ์ภายนอก
- สำคัญ: คุณต้องทำตามขั้นตอนการกำหนดค่าเหล่านี้ในเซิร์ฟเวอร์การจัดการ Apigee Edge แต่ละเซิร์ฟเวอร์ (หากคุณใช้งานมากกว่า 1 เซิร์ฟเวอร์)
- เปิด /opt/apigee/customer/application/management-server.properties ในเครื่องมือแก้ไขข้อความ หากไม่มีไฟล์ ให้สร้างไฟล์
- เพิ่มบรรทัดต่อไปนี้ หมายเหตุ: ตรวจสอบว่าไม่มีการเว้นวรรคต่อท้ายที่ท้ายบรรทัด
conf_security_authentication.user.store=externalized.authentication
บรรทัดนี้จะเพิ่มฟีเจอร์การตรวจสอบสิทธิ์ภายนอกลงในการติดตั้ง Edge for Private Cloud - เราได้สร้างตัวอย่างการกำหนดค่า 2 รายการที่มีความคิดเห็นประกอบอย่างละเอียด ได้แก่ การกำหนดค่าสำหรับการตรวจสอบสิทธิ์การเชื่อมโยงโดยตรงและการกำหนดค่าสำหรับการตรวจสอบสิทธิ์การเชื่อมโยงโดยอ้อม เพื่อให้ขั้นตอนนี้ง่ายขึ้น ดูตัวอย่างด้านล่างสำหรับการเชื่อมโยงที่คุณต้องการใช้ และทำการกำหนดค่าให้เสร็จสมบูรณ์
ตัวอย่างการกำหนดค่า DIRECT BINDING
ตัวอย่างการกำหนดค่า INDIRECT BINDING - รีสตาร์ทเซิร์ฟเวอร์การจัดการ:
> /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart - ตรวจสอบว่าเซิร์ฟเวอร์ทำงานอยู่:
> /opt/apigee/apigee-service/bin/apigee-all status - สำคัญ: คุณต้องกำหนดค่าเพิ่มเติมภายใต้สถานการณ์ต่อไปนี้ (หรือทั้ง 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, 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}
ตัวอย่างการกำหนดค่า INDIRECT 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
การทดสอบการติดตั้ง
- ตรวจสอบว่าเซิร์ฟเวอร์ทำงานอยู่:
> /opt/apigee/apigee-service/bin/apigee-all status - เรียกใช้คำสั่งนี้โดยระบุชุดข้อมูลเข้าสู่ระบบของผู้ดูแลระบบส่วนกลางของ 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/v1/o -u jdoe@mydomain.com - ป้อนรหัสผ่านเมื่อได้รับข้อความแจ้ง
หากคำสั่งแสดงสถานะ 200 และรายชื่อองค์กร แสดงว่าการกำหนดค่าถูกต้อง คำสั่งนี้จะยืนยันว่าการเรียก API ไปยัง Edge Management Server ได้รับการตรวจสอบสิทธิ์ผ่านระบบ LDAP ภายนอกเรียบร้อยแล้ว