فعال کردن اصالت‌سنجی خارجی

Edge for Private Cloud نسخه ۴.۱۷.۰۹

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

پیش‌نیازها

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

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

    نام کاربری: edgeuser@mydomain.com
    گذرواژه: Secret123

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

درحال پیکربندی اصالت‌سنجی خارجی

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

  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. مهم: در یکی از شرایط زیر (یا هر دو) باید پیکربندی دیگری انجام دهید: (الف) اگر قصد دارید کاربران بااستفاده از نام‌های کاربری که نشانی ایمیل نیستند به سیستم وارد شوند. در این حالت، کاربر سرپرست سیستم شما باید با نام کاربری نیز اصالت‌سنجی شود و/یا (ب) اگر گذرواژه حساب کاربری سرپرست سیستم شما در LDAP خارجی‌تان با گذرواژه‌ای که هنگام نصب اولیه Apigee Edge برای Private Cloud پیکربندی کرده‌اید متفاوت باشد. پیکربندی موردنیاز برای اعتبارنامه‌های مختلف سرپرست سیستم را ببینید.

نمونه پیکربندی اتصال مستقیم

## 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 را ارائه دهید. فراخوان میانای برنامه‌سازی کاربردی که می‌خواهیم آزمایش کنیم فقط توسط سرپرست سیستم 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
  3. وقتی از شما خواسته شد، گذرواژه‌تان را وارد کنید.

    اگر فرمان وضعیت ۲۰۰ و فهرستی از سازمان‌ها را برگرداند، پیکربندی درست است. این فرمان تأیید می‌کند که فراخوانی میانای برنامه‌سازی کاربردی به Edge Management Server باموفقیت ازطریق سیستم LDAP خارجی اصالت‌سنجی شده است.