Apigee एसएसओ (SSO) इंस्टॉल और कॉन्फ़िगर करें

किसी बाहरी आईडीपी के साथ Apigee एसएसओ (SSO) मॉड्यूल को इंस्टॉल और कॉन्फ़िगर करने के लिए, आपको ये काम करने होंगे:

  1. कुंजियां और सर्टिफ़िकेट बनाएं.
  2. बेस Apigee एसएसओ (SSO) कॉन्फ़िगरेशन सेट अप करना: बेस फ़ाइल में ऐसी प्रॉपर्टी शामिल होनी चाहिए जो सभी एसएसओ (SSO) कॉन्फ़िगरेशन के लिए आम तौर पर इस्तेमाल होती हैं.
  3. आईडीपी से जुड़ी कॉन्फ़िगरेशन प्रॉपर्टी जोड़ें: अपनी कॉन्फ़िगरेशन फ़ाइल में, आईडीपी से जुड़ी कॉन्फ़िगरेशन प्रॉपर्टी के इन ब्लॉक में से किसी एक का इस्तेमाल करें:
  4. Apigee एसएसओ (SSO) इंस्टॉल करें: Apigee एसएसओ (SSO) मॉड्यूल इंस्टॉल करें और इंस्टॉलर को कॉन्फ़िगरेशन फ़ाइल भेजें.

इनमें से हर चरण के बारे में, बाद के सेक्शन में बताया गया है.

कुंजियां और सर्टिफ़िकेट बनाएं

इस सेक्शन में, खुद से हस्ताक्षर किए गए सर्टिफ़िकेट बनाने का तरीका बताया गया है. ये सर्टिफ़िकेट आपके टेस्टिंग एनवायरमेंट के लिए सही हो सकते हैं. हालांकि, प्रोडक्शन एनवायरमेंट के लिए आपको सर्टिफ़िकेट देने वाली संस्था (सीए) के हस्ताक्षर किए गए सर्टिफ़िकेट इस्तेमाल करने चाहिए.

पुष्टि के लिए साइन करने के लिए, कुंजी का जोड़ा बनाने का तरीका:

  1. sudo उपयोगकर्ता के तौर पर, यह नई डायरेक्ट्री बनाएं:
    sudo mkdir -p /opt/apigee/customer/application/apigee-sso/jwt-keys
  2. नई डायरेक्ट्री में बदलें:
    cd /opt/apigee/customer/application/apigee-sso/jwt-keys/
  3. नीचे दिए गए निर्देश की मदद से निजी कुंजी जनरेट करें:
    sudo openssl genrsa -out privkey.pem 2048
  4. नीचे दिए गए निर्देश की मदद से, निजी कुंजी से सार्वजनिक कुंजी जनरेट करें:
    sudo openssl rsa -pubout -in privkey.pem -out pubkey.pem
  5. आउटपुट PEM फ़ाइल के मालिक को बदलकर "apigee" उपयोगकर्ता बनाएं:
    sudo chown apigee:apigee *.pem

आईडीपी के साथ कम्यूनिकेट करने के लिए, बिना लंबा पासवर्ड के कुंजी और खुद हस्ताक्षर किया गया सर्टिफ़िकेट बनाने के लिए:

  1. sudo उपयोगकर्ता के तौर पर, एक नई डायरेक्ट्री बनाएं:
    sudo mkdir -p /opt/apigee/customer/application/apigee-sso/idp/
  2. नई डायरेक्ट्री में बदलें:
    cd /opt/apigee/customer/application/apigee-sso/idp/
  3. लंबे पासवर्ड का इस्तेमाल करके, अपनी निजी कुंजी जनरेट करें:
    sudo openssl genrsa -aes256 -out server.key 1024
  4. कुंजी से लंबा पासवर्ड हटाएं:
    sudo openssl rsa -in server.key -out server.key
  5. सीए के लिए, सर्टिफ़िकेट पर हस्ताक्षर करने का अनुरोध जनरेट करें:
    sudo openssl req -x509 -sha256 -new -key server.key -out server.csr
  6. खुद हस्ताक्षर किया गया सर्टिफ़िकेट जनरेट करें. इसकी समयसीमा 365 दिनों की होती है:
    sudo openssl x509 -sha256 -days 365 -in server.csr -signkey server.key -out selfsigned.crt
  7. कुंजी और crt फ़ाइल के मालिक को बदलकर "apigee" मालिक कर दें:
    sudo chown apigee:apigee server.key
    sudo chown apigee:apigee selfsigned.crt

Apigee एसएसओ (SSO) मॉड्यूल पर TLS को चालू करने के लिए, SSO_TOMCAT_PROFILE को SSL_TERMINATION या SSL_PROXY पर सेट करके, खुद हस्ताक्षर किए गए सर्टिफ़िकेट का इस्तेमाल नहीं किया जा सकता. आपको सीए से सर्टिफ़िकेट जनरेट करना होगा. ज़्यादा जानकारी के लिए, एचटीटीपीएस ऐक्सेस के लिए Apigee एसएसओ (SSO) को कॉन्फ़िगर करना देखें.

Apigee एसएसओ (SSO) कॉन्फ़िगरेशन की सेटिंग

Apigee एसएसओ (SSO) मॉड्यूल इंस्टॉल करने से पहले, आपको एक कॉन्फ़िगरेशन फ़ाइल तय करनी होगी. Apigee एसएसओ (SSO) मॉड्यूल इंस्टॉल करते समय, इस कॉन्फ़िगरेशन फ़ाइल को इंस्टॉलर को पास किया जाता है.

कॉन्फ़िगरेशन फ़ाइल इस तरह का है:

IP1=hostname_or_IP_of_apigee_SSO
IP2=hostname_or_IP_of_apigee_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.
# If these credentials change, they must be updated and setup rerun.
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 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 on the SSO sign-in page after being redirected by either the New or Classic Edge UI for SAML logins.
# Note: Installing SSO does not depend on the Edge UI or which version of the UI you are using.
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.50.00.05.
SSO_SAML_SIGNED_ASSERTIONS=y

एलडीएपी डायरेक्ट बाइंडिंग कॉन्फ़िगरेशन प्रॉपर्टी

अगर अपने आईडीपी के लिए 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 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

# 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

Apigee एसएसओ (SSO) मॉड्यूल इंस्टॉल करें

कुंजियां बनाने और कॉन्फ़िगरेशन फ़ाइल सेट अप करने के बाद, Apigee एसएसओ (SSO) मॉड्यूल इंस्टॉल किया जा सकता है.

Apigee एसएसओ (SSO) मॉड्यूल इंस्टॉल करने के लिए:

  1. मैनेजमेंट सर्वर नोड में लॉग इन करें. उस नोड में apigee-service पहले से ही इंस्टॉल होना चाहिए, जैसा कि Edge apigee-setup उपयोगिता को इंस्टॉल करें में बताया गया है.

    इसके अलावा, आपके पास किसी दूसरे नोड पर Apigee एसएसओ (SSO) मॉड्यूल इंस्टॉल करने का विकल्प है. हालांकि, वह नोड पोर्ट 8080 से मैनेजमेंट सर्वर को ऐक्सेस करने में सक्षम होना चाहिए.

  2. नीचे दिए गए निर्देश का इस्तेमाल करके, apigee-sso को इंस्टॉल और कॉन्फ़िगर करें:
    /opt/apigee/apigee-setup/bin/setup.sh -p sso -f configFile

    यहां configFile, वह कॉन्फ़िगरेशन फ़ाइल है जिसके बारे में आपने ऊपर बताया है.

  3. apigee-sso मॉड्यूल के लिए, एडमिन और मशीन उपयोगकर्ताओं को मैनेज करने के लिए इस्तेमाल की जाने वाली apigee-ssoadminapi.sh यूटिलिटी इंस्टॉल करें:
    /opt/apigee/apigee-service/bin/apigee-service apigee-ssoadminapi install
  4. शेल से लॉग आउट करें और फिर अपने पाथ में apigee-ssoadminapi.sh उपयोगिता जोड़ने के लिए, फिर से लॉग इन करें.

यूआरएल के बजाय मेटाडेटा फ़ाइल डालें

अगर आपका आईडीपी, एचटीटीपी/एचटीटीपीएस मेटाडेटा यूआरएल के साथ काम नहीं करता, तो Apigee एसएसओ (SSO) को कॉन्फ़िगर करने के लिए, मेटाडेटा की एक्सएमएल फ़ाइल का इस्तेमाल किया जा सकता है.

Apigee एसएसओ को कॉन्फ़िगर करने के लिए, यूआरएल के बजाय मेटाडेटा फ़ाइल का इस्तेमाल करने के लिए:

  1. मेटाडेटा एक्सएमएल के कॉन्टेंट को, अपने आईडीपी से Apigee एसएसओ (SSO) नोड पर मौजूद फ़ाइल में कॉपी करें. उदाहरण के लिए, एक्सएमएल को यहां कॉपी करें:
    /opt/apigee/customer/application/apigee-sso/saml/metadata.xml
  2. एक्सएमएल फ़ाइल के मालिकाना हक को "apigee" उपयोगकर्ता को दें:
    chown apigee:apigee /opt/apigee/customer/application/apigee-sso/saml/metadata.xml
  3. SSO_SAML_IDP_METADATA_URL की वैल्यू को फ़ाइल पाथ पर सेट करें:
    SSO_SAML_IDP_METADATA_URL=file:///opt/apigee/customer/application/apigee-sso/saml/metadata.xml

    आपको फ़ाइल पाथ से पहले "file://" लगाना होगा. इसके बाद, रूट (/) से ऐब्सलूट पाथ शुरू करना होगा.