لتثبيت وحدة الدخول المُوحَّد (SSO) في Apigee وضبطها باستخدام IDP خارجي، عليك تنفيذ ما يلي:
- إنشاء مفاتيح وشهادات بروتوكول أمان طبقة النقل (TLS): تستخدم وحدة الدخول المُوحَّد (SSO) في Apigee بروتوكول أمان طبقة النقل (TLS) لتأمين نقل المعلومات مع الجهات الخارجية.
- إعداد الإعدادات الأساسية لخدمة الدخول المُوحَّد (SSO) في Apigee: يجب أن يتضمّن الملف الأساسي السمات الشائعة في جميع إعدادات الدخول المُوحَّد (SSO).
- إضافة سمات الإعدادات الخاصة بموفِّر الهوية: استخدِم إحدى مجموعات سمات الإعدادات التالية الخاصة بموفِّر الهوية في ملف الإعداد:
- تثبيت Apigee SSO: ثبِّت وحدة Apigee SSO، وأرسِل ملف الإعداد إلى أداة التثبيت.
يتم وصف كل خطوة من هذه الخطوات في الأقسام التالية.
إنشاء مفاتيح وشهادات بروتوكول أمان طبقة النقل (TLS)
يوضّح هذا القسم كيفية إنشاء شهادات موقَّعة ذاتيًا قد تكون مناسبة لبيئة الاختبار، ولكن يجب استخدام شهادات موقَّعة من قِبل هيئة إصدار الشهادات (CA) لبيئة التشغيل الفعلي.
لإنشاء مفتاح التحقّق والتوقيع والشهادة الموقَّعة ذاتيًا:
- بصفتك مستخدم sudo، أنشئ الدليل الجديد التالي:
sudo mkdir -p /opt/apigee/customer/application/apigee-sso/jwt-keys
- انتقِل إلى الدليل الجديد:
cd /opt/apigee/customer/application/apigee-sso/jwt-keys/
- أنشئ المفتاح الخاص باستخدام الأمر التالي:
sudo openssl genrsa -out privkey.pem 2048
- أنشِئ المفتاح العام من المفتاح الخاص باستخدام الأمر التالي:
sudo openssl rsa -pubout -in privkey.pem -out pubkey.pem
- غيِّر مالك ملف PEM الناتج إلى المستخدم "apigee":
sudo chown apigee:apigee *.pem
لإنشاء المفتاح والشهادة الموقَّعة ذاتيًا، بدون عبارة مرور، للتواصل مع موفِّر الهوية:
- بصفتك مستخدم sudo، أنشئ دليلاً جديدًا:
sudo mkdir -p /opt/apigee/customer/application/apigee-sso/idp/
- انتقِل إلى الدليل الجديد:
cd /opt/apigee/customer/application/apigee-sso/idp/
- أنشِئ مفتاحك الخاص باستخدام عبارة مرور:
sudo openssl genrsa -aes256 -out server.key 1024
- أزِل عبارة المرور من المفتاح:
sudo openssl rsa -in server.key -out server.key
- إنشاء طلب توقيع شهادة لمرجع التصديق:
sudo openssl req -x509 -sha256 -new -key server.key -out server.csr
- أنشئ شهادة موقَّعة ذاتيًا تنتهي صلاحيتها بعد 365 يومًا:
sudo openssl x509 -sha256 -days 365 -in server.csr -signkey server.key -out selfsigned.crt
- غيِّر مالك ملف المفتاح وشهادة crt إلى المالك "apigee":
sudo chown apigee:apigee server.key
sudo chown apigee:apigee selfsigned.crt
لتفعيل بروتوكول أمان طبقة النقل (TLS) في وحدة الدخول الموحّد (SSO) في Apigee، من خلال ضبط SSO_TOMCAT_PROFILE على SSL_TERMINATION أو على SSL_PROXY، لا يمكنك استخدام شهادة موقَّعة ذاتيًا. يجب إنشاء شهادة من مرجع تصديق. لمزيد من المعلومات، يُرجى الاطّلاع على ضبط الدخول المُوحَّد (SSO) في Apigee للوصول إلى HTTPS.
إعدادات ضبط الدخول المُوحَّد (SSO) في Apigee
قبل تثبيت وحدة الدخول المُوحَّد (SSO) في Apigee، عليك تحديد ملف إعداد. يتم تمرير ملف الإعداد هذا إلى أداة التثبيت عند تثبيت وحدة الدخول المُوحَّد (SSO) في Apigee.
يأخذ ملف الإعداد الشكل التالي:
IP1=hostname_or_IP_of_management_server IP2=hostname_or_IP_of_UI_and_apigge_SSO ## Management Server configuration. # Management Server IP address and port MSIP=$IP1 MGMT_PORT=8080 # Edge sys admin username and password as set when you installed Edge. ADMIN_EMAIL=opdk@google.com APIGEE_ADMINPW=Secret123 # Set the protocol for the Edge management API. Default is http. # Set to https if you enabled TLS on the management API. MS_SCHEME=http ## Postgres configuration. # Postgres IP address and port PG_HOST=$IP1 PG_PORT=5432 # Postgres username and password as set when you installed Edge. PG_USER=apigee PG_PWD=postgres ## Apigee SSO module configuration. #Choose either "saml" or "ldap". SSO_PROFILE="[saml|ldap]" # Externally accessible IP or DNS name of apigee-sso. SSO_PUBLIC_URL_HOSTNAME=$IP2 SSO_PG_DB_NAME=database_name_for_sso # Default port is 9099. If changing, set both properties to the same value. SSO_PUBLIC_URL_PORT=9099 SSO_TOMCAT_PORT=9099 # Set Tomcat TLS mode to DEFAULT to use HTTP access to apigee-sso. SSO_TOMCAT_PROFILE=DEFAULT SSO_PUBLIC_URL_SCHEME=http # SSO admin user name. The default is ssoadmin. SSO_ADMIN_NAME=ssoadmin # SSO admin password using uppercase, lowercase, number, and special chars. SSO_ADMIN_SECRET=Secret123 # Enable the ability to sign an authentication request with SAML SSO. SSO_SAML_SIGN_REQUEST=y # Path to signing key and secret from Create the TLS keys and certificates above. SSO_JWT_SIGNING_KEY_FILEPATH=/opt/apigee/customer/application/apigee-sso/jwt-keys/privkey.pem SSO_JWT_VERIFICATION_KEY_FILEPATH=/opt/apigee/customer/application/apigee-sso/jwt-keys/pubkey.pem ########################################################### # Define External IDP # # Use one of the following configuration blocks to # # define your IDP settings: # # - SAML configuration properties # # - LDAP Direct Binding configuration properties # # - LDAP Indirect Binding configuration properties # ########################################################### INSERT_IDP_CONFIG_BLOCK_HERE (SAML, LDAP direct, or LDAP indirect, below) # Configure an SMTP server so that the Apigee SSO module can send emails to users SKIP_SMTP=n SMTPHOST=smtp.example.com SMTPUSER=smtp@example.com # omit for no username SMTPPASSWORD=smtppwd # omit for no password SMTPSSL=n SMTPPORT=25 # The address from which emails are sent SMTPMAILFROM="My Company <myco@company.com>"
خصائص إعدادات الدخول المُوحَّد (SSO) عبر SAML
إذا كنت تستخدم SAML لموفِّر الهوية، استخدِم مجموعة سمات الإعدادات التالية في ملف الإعداد (المحدّد أعلاه):
## SAML Configuration Properties # Insert this section into your base configuration file, as described previously. # Name of SAML IDP. For example, okta or adfs. SSO_SAML_IDP_NAME=okta # Text displayed to user when they attempt to access Edge UI. SSO_SAML_IDP_LOGIN_TEXT="Please log in to your IDP" # The metadata URL from your IDP. # If you have a metadata file, and not a URL, # see "Specifying a metadata file instead of a URL" below. SSO_SAML_IDP_METADATA_URL=https://dev-343434.oktapreview.com/app/exkar20cl/sso/saml/metadata # Determines whether to skip TLS validation for the URL specified # by SSO_SAML_IDP_METADATA_URL. # This is necessary if the URL uses a self-signed certificate. # The default value is "n". SSO_SAML_IDPMETAURL_SKIPSSLVALIDATION=n # SAML service provider key and cert from Create the TLS keys and certificates above. SSO_SAML_SERVICE_PROVIDER_KEY=/opt/apigee/customer/application/apigee-sso/saml/server.key SSO_SAML_SERVICE_PROVIDER_CERTIFICATE=/opt/apigee/customer/application/apigee-sso/saml/selfsigned.crt # The passphrase used when you created the SAML cert and key. # The section "Create the TLS keys and certificates" above removes the passphrase, # but this property is available if you require a passphrase. # SSO_SAML_SERVICE_PROVIDER_PASSWORD=samlSP123 # Requires that SAML responses be signed by your IDP. # This property is enabled by default since release 4.19.06.12. SSO_SAML_SIGNED_ASSERTIONS=y
خصائص إعدادات الربط المباشر لبروتوكول LDAP
إذا كنت تستخدم الربط المباشر لبروتوكول LDAP لموفِّر الهوية، استخدِم مجموعة خصائص الإعداد التالية في ملف الإعداد، كما هو موضّح في المثال أعلاه:
## LDAP Direct Binding configuration # Insert this section into your base configuration file, as described previously. # The type of LDAP profile; in this case, "direct" SSO_LDAP_PROFILE=direct # The base URL to which SSO connects; in the form: "ldap://hostname_or_IP:port SSO_LDAP_BASE_URL=LDAP_base_URL # Attribute name used by the LDAP server to refer to the user's email address; for example, "mail" SSO_LDAP_MAIL_ATTRIBUTE=LDAP_email_attribute # Pattern of the user's DN; for example: =cn={0},ou=people,dc=example,dc=org # If there is more than one pattern, separate with semicolons (";"); for example: # =cn={0},ou=people,dc=example,dc=org;=cn={0},ou=people,dc=example,dc=com SSO_LDAP_USER_DN_PATTERN=LDAP_DN_pattern
خصائص إعدادات الربط غير المباشر لبروتوكول LDAP
إذا كنت تستخدم الربط غير المباشر لبروتوكول LDAP لموفِّر الهوية، استخدِم مجموعة خصائص الإعداد التالية في ملف الإعداد، كما هو موضَّح في المثال أعلاه:
## LDAP Indirect Binding configuration # Insert this section into your base configuration file, as described previously. # Type of LDAP profile; in this case, "indirect" SSO_LDAP_PROFILE=indirect # Base URL to which SSO connects; in the form: "ldap://hostname_or_IP:port SSO_LDAP_BASE_URL=LDAP_base_URL # DN and password of the LDAP server's admin user SSO_LDAP_ADMIN_USER_DN=LDAP_admin_DN SSO_LDAP_ADMIN_PWD=LDAP_admin_password # LDAP search base; for example, "dc=example,dc=org" SSO_LDAP_SEARCH_BASE=LDAP_search_base # LDAP search filter; for example, "cn={0}" SSO_LDAP_SEARCH_FILTER=LDAP_search_filter
تثبيت وحدة الدخول المُوحَّد (SSO) في Apigee
بعد إنشاء المفاتيح وإعداد ملف الإعداد، يمكنك تثبيت وحدة الدخول الموحّد (SSO) في Apigee.
لتثبيت وحدة الدخول المُوحَّد (SSO) في Apigee:
- سجِّل الدخول إلى عقدة خادم الإدارة. يجب أن تكون هذه العقدة قد تم تثبيت
apigee-serviceعليها، كما هو موضح في تثبيت أداة إعداد Edge apigee.بدلاً من ذلك، يمكنك تثبيت وحدة الدخول الموحّد (SSO) في Apigee على عقدة مختلفة. ومع ذلك، يجب أن تتمكّن هذه العقدة من الوصول إلى خادم الإدارة عبر المنفذ 8080.
- ثبِّت
apigee-ssoواضبطه من خلال تنفيذ الأمر التالي:/opt/apigee/apigee-setup/bin/setup.sh -p sso -f configFile
حيث يمثّل configFile ملف الإعداد الذي حدّدته أعلاه.
- ثبِّت الأداة المساعدة
apigee-ssoadminapi.shالمستخدَمة لإدارة المشرف ومستخدمي الأجهزة للوحدةapigee-sso:/opt/apigee/apigee-service/bin/apigee-service apigee-ssoadminapi install
- سجِّل الخروج من واجهة الأوامر، ثم سجِّل الدخول مرة أخرى لإضافة الأداة المساعدة
apigee-ssoadminapi.shإلى المسار.
تحديد ملف بيانات وصفية بدلاً من عنوان URL
إذا كان موفّر الهوية لا يتيح استخدام عنوان URL للبيانات الوصفية يتضمّن HTTP/HTTPS، يمكنك استخدام ملف XML للبيانات الوصفية من أجل ضبط خدمة الدخول المُوحَّد (SSO) في Apigee.
لاستخدام ملف بيانات وصفية بدلاً من عنوان URL لضبط الدخول المُوحَّد في Apigee:
- انسخ محتوى ملف XML للبيانات الوصفية من موفِّر الهوية إلى ملف على عقدة الدخول المُوحَّد في Apigee. على سبيل المثال، انسخ ملف XML إلى:
/opt/apigee/customer/application/apigee-sso/saml/metadata.xml
- غيِّر ملكية ملف XML إلى المستخدم "apigee":
chown apigee:apigee /opt/apigee/customer/application/apigee-sso/saml/metadata.xml
- اضبط قيمة
SSO_SAML_IDP_METADATA_URLعلى مسار الملف المطلق:SSO_SAML_IDP_METADATA_URL=file:///opt/apigee/customer/application/apigee-sso/saml/metadata.xml
يجب أن تسبق مسار الملف البادئة "
file://"، متبوعة بالمسار المطلق من الجذر (/).