تفعيل المصادقة الخارجية

يوضّح هذا القسم كيفية الحصول على المكوّنات المطلوبة لدمج خدمة LDAP في Apigee Edge لمصادقة المستخدمين وتثبيتها وضبطها.

المتطلبات الأساسية

  • يجب أن يكون لديك تثبيت Apigee Edge for Private Cloud 4.18.05.
  • يجب أن تكون لديك بيانات اعتماد مشرف النظام العام على Apigee Edge for Private Cloud لإجراء هذا التثبيت.
  • يجب معرفة الدليل الجذري لتثبيت Apigee Edge for Private Cloud. الدليل الجذر التلقائي هو /opt.
  • يجب إضافة بيانات اعتماد مشرف النظام العام في Edge إلى LDAP الخارجي. يُرجى العِلم أنّه يتم تلقائيًا تخزين بيانات اعتماد مشرف النظام في LDAP الداخلي في Edge. بعد التبديل إلى LDAP الخارجي، ستتم مصادقة بيانات اعتماد مشرف النظام هناك بدلاً من ذلك. لذلك، يجب توفير بيانات الاعتماد للنظام الخارجي قبل تفعيل المصادقة الخارجية في Edge.

    على سبيل المثال، إذا كنت قد ضبطت Apigee Edge for Private Cloud وثبّته باستخدام بيانات اعتماد مشرف النظام العام على النحو التالي:

    username: edgeuser@mydomain.com
    password: Secret123

    بعد ذلك، يجب أن يكون المستخدم edgeuser@mydomain.com الذي لديه كلمة المرور Secret123 موجودًا أيضًا في LDAP الخارجي.

  • إذا كنت تستخدم مجموعة خوادم إدارة، يُرجى العِلم أنّه عليك تنفيذ جميع الخطوات الواردة في هذا المستند لكل خادم إدارة.

ضبط إعدادات المصادقة الخارجية

النشاط الرئيسي الذي ستنفّذه هو ضبط ملف management-server.properties. يتضمّن هذا النشاط إيقاف خادم إدارة Edge وبدء تشغيله، وتحديد ما إذا كنت تريد استخدام الربط المباشر أو غير المباشر، وتشفير بيانات الاعتماد الحسّاسة، والمهام الأخرى ذات الصلة.

  1. ملاحظة مهمة: عليك تحديد ما إذا كنت تنوي استخدام طريقة المصادقة غير المباشرة أو المباشرة. سيؤثر هذا القرار في بعض جوانب الإعداد. يُرجى الاطّلاع على المصادقة الخارجية.
  2. ملاحظة مهمة: يجب تنفيذ خطوات الضبط هذه على كل خادم إدارة في Apigee Edge (إذا كنت تستخدم أكثر من خادم واحد).
  3. افتح /opt/apigee/customer/application/management-server.properties في محرِّر نصوص. إذا لم يكن الملف متوفّرًا، أنشِئه.
  4. أضِف السطر التالي:
    conf_security_authentication.user.store=externalized.authentication

    يضيف هذا السطر ميزة المصادقة الخارجية إلى تثبيت Edge for Private Cloud.

  5. لتسهيل هذه الخطوة، أنشأنا نموذجَين للإعدادات مع التعليقات، أحدهما للمصادقة المباشرة والآخر للمصادقة غير المباشرة. اطّلِع على النماذج أدناه لمعرفة الربط الذي تريد استخدامه، وأكمِل عملية الضبط:
  6. أعِد تشغيل خادم الإدارة:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. تأكَّد من أنّ الخادم قيد التشغيل:
    /opt/apigee/apigee-service/bin/apigee-all status
  8. ملاحظة مهمة: يجب إجراء عملية ضبط إضافية في أي من (أو كلتا) الحالتين التاليتين:
    1. إذا كنت تنوي السماح للمستخدمين بتسجيل الدخول باستخدام أسماء مستخدمين ليست عناوين بريد إلكتروني. وفي هذه الحالة، يجب أن تتم مصادقة مستخدم مشرف النظام أيضًا باستخدام اسم مستخدم.

      AND/OR

    2. إذا كانت كلمة مرور حساب مستخدم مشرف النظام في LDAP الخارجي تختلف عن كلمة المرور التي ضبطتها عند تثبيت Apigee Edge for 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. لا يمكن تنفيذ طلب البيانات من واجهة برمجة التطبيقات الذي سنختبره إلا من خلال مشرف نظام 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 وقائمة بالمؤسسات، يعني ذلك أنّ الإعدادات صحيحة. يتحقّق هذا الأمر من أنّه تمت مصادقة طلب البيانات من واجهة برمجة التطبيقات إلى خادم إدارة Edge بنجاح من خلال نظام LDAP الخارجي.