فعال کردن احراز هویت خارجی

Edge for Private Cloud نسخه 4.18.01

این بخش نحوه دریافت، نصب و پیکربندی اجزای مورد نیاز برای ادغام یک سرویس LDAP خارجی در Apigee Edge را برای احراز هویت کاربر توضیح می‌دهد.

پیش نیازها

  • برای نصب Private Cloud 4.18.01 باید Apigee Edge داشته باشید.
  • برای انجام این نصب باید اعتبارنامه مدیر سیستم جهانی را در Apigee Edge for Private Cloud داشته باشید.
  • شما باید دایرکتوری ریشه Apigee Edge خود را برای نصب Cloud خصوصی بدانید. دایرکتوری ریشه پیش فرض /opt است.
  • شما باید اعتبار مدیر سیستم جهانی Edge خود را به LDAP خارجی اضافه کنید. به یاد داشته باشید که به طور پیش‌فرض، اعتبار sysadmin در LDAP داخلی Edge ذخیره می‌شود. هنگامی که به LDAP خارجی سوئیچ کردید، در عوض اعتبار سیستم سیستم شما در آنجا احراز هویت می شود. بنابراین، قبل از فعال کردن احراز هویت خارجی در Edge، باید اعتبارنامه را در اختیار سیستم خارجی قرار دهید.

    به عنوان مثال، اگر Apigee Edge را برای Private Cloud با اعتبار مدیر سیستم جهانی پیکربندی و نصب کرده باشید:

    نام کاربری: edgeuser@mydomain.com
    رمز عبور: Secret123

    سپس کاربر edgeuser@mydomain.com با رمز عبور Secret123 نیز باید در LDAP خارجی وجود داشته باشد.
  • اگر از یک کلاستر مدیریت سرور استفاده می کنید، توجه داشته باشید که باید تمام مراحل این سند را برای هر سرور مدیریت انجام دهید.

پیکربندی احراز هویت خارجی

فعالیت اصلی که انجام خواهید داد، پیکربندی فایل management-server.properties است. این فعالیت شامل توقف و راه‌اندازی سرور مدیریت لبه، تصمیم‌گیری در مورد استفاده از اتصال مستقیم یا غیرمستقیم، رمزگذاری اطلاعات کاربری حساس و سایر کارهای مرتبط است.

  1. مهم : اکنون تصمیم بگیرید که آیا قصد دارید از روش احراز هویت غیرمستقیم یا مستقیم استفاده کنید. این تصمیم بر برخی از جنبه های پیکربندی تأثیر می گذارد. احراز هویت خارجی را ببینید.
  2. مهم : شما باید این مراحل پیکربندی را در هر سرور مدیریت Apigee Edge انجام دهید (اگر بیش از یک سرور را اجرا می کنید).
  3. /opt/apigee/customer/application/management-server.properties را در یک ویرایشگر متن باز کنید. اگر فایل وجود ندارد، آن را ایجاد کنید.
  4. خط زیر را اضافه کنید. توجه: مطمئن شوید که هیچ فضای انتهایی در انتهای خط وجود ندارد .

    conf_security_authentication.user.store=externalized.authentication

    این خط ویژگی احراز هویت خارجی را به نصب Edge شما برای Private Cloud اضافه می کند.
  5. برای آسان کردن این مرحله، ما دو پیکربندی نمونه با نظر خوب ایجاد کرده‌ایم - یکی برای احراز هویت مستقیم و دیگری برای احراز هویت غیرمستقیم . نمونه های زیر را برای صحافی که می خواهید استفاده کنید ببینید و پیکربندی را تکمیل کنید:

    نمونه پیکربندی DIRECT BINDING
    نمونه پیکربندی INDIRECT BINDING
  6. راه اندازی مجدد سرور مدیریت:
    > /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart
  7. بررسی کنید که سرور در حال اجرا است:
    > وضعیت /opt/apigee/apigee-service/bin/apigee-all
  8. مهم : شما باید پیکربندی اضافی را در یکی از شرایط زیر (یا هر دو) انجام دهید: (الف) اگر قصد دارید کاربران با استفاده از نام‌های کاربری که آدرس ایمیل نیستند وارد سیستم شوند. در این حالت، اگر رمز عبور حساب کاربری sysadmin شما در LDAP خارجی شما با رمز عبوری که در اولین نصب Apigee Edge برای Private Cloud پیکربندی کرده‌اید متفاوت باشد، کاربر sysadmin شما نیز باید با یک نام کاربری و/یا (b) احراز هویت کند. به پیکربندی مورد نیاز برای اعتبارنامه های مختلف sysadmin مراجعه کنید.

نمونه پیکربندی 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

تست نصب

  1. بررسی کنید که سرور در حال اجرا است:
    > وضعیت /opt/apigee/apigee-service/bin/apigee-all
  2. این دستور را اجرا کنید و مجموعه ای از اعتبارنامه های مدیریت سیستم جهانی Apigee Edge را ارائه دهید. فراخوانی API که ما قصد داریم آن را آزمایش کنیم، فقط توسط یک sysadmin Edge قابل اجرا است.

    مهم : اعتبارنامه های یکسان باید در حساب LDAP خارجی شما وجود داشته باشد. اگر نه، باید آنها را اکنون اضافه کنید. توجه داشته باشید که نام کاربری معمولا یک آدرس ایمیل است. با این حال، همانطور که قبلا در این سند توضیح داده شد، بستگی به نحوه پیکربندی احراز هویت خارجی دارد.
    > curl -v http://< management-server-ip >:8080/v1/o -u < نام کاربری Sysadmin >

    مثلا:
    > curl -v http://192.168.52.100:8080/v1/o -u jdoe@mydomain.com
  3. وقتی از شما خواسته شد رمز عبور خود را وارد کنید.

    اگر فرمان وضعیت 200 و لیستی از سازمان ها را برگرداند، پیکربندی صحیح است. این دستور تأیید می کند که فراخوانی API به سرور مدیریت لبه با موفقیت از طریق سیستم LDAP خارجی تأیید شده است.