HCL Commerce Version 9.1.5.0 or later

Enabling security with federated repositories

To use HCL Commerce with LDAP, you must configure WebSphere Application Server Administrative Security with Federated Repositories. The federated repositories consist of one or more LDAP servers and a built-in, file-based repository.

The file-based repository stores the WebSphere Application Server Primary Administrative User. Even if the LDAP server is unavailable, the Primary Administrative User can still log on to the WebSphere Application Server administrative console.

Before you begin

Ensure that you complete the following tasks:

  • Ensure that the database is started.
  • Ensure that the LDAP server is started.
  • HCL Commerce DeveloperHCL Commerce Version 9.1.6.0 or laterEnsure that the WebSphere Application Server is running.
  • HCL Commerce DeveloperHCL Commerce Version 9.1.6.0 or laterIf you are using SSL with the LDAP server, ensure that the WebSphere Application Server administrative security is enabled by using the file-based registry. If the administrative security is not enabled, the configuration scripts fail.
  • If you are planning to set up HCL Commerce to connect with multiple LDAP servers, see the sample configuration steps in Federating two LDAP servers with a common root organization.
Important:
  • HCL Commerce does not support rolling back to use the database repository after you configure HCL Commerce to use an LDAP repository.
  • LDAP integration for HCL Commerce is implemented in Version 9.1.5. Ensure that you are using this version of HCL Commerce or greater.

About this task

The HCL Commerce LDAP integration supports the following LDAP server options:
  • IBM Security Directory Server
  • Custom LDAP v3 compliant server

Procedure

Complete the following steps to enable WebSphere Application Server security with Federated Repositories:
  1. Copy vmm.properties file from the following location in the ts-app or ts-utils container.
    • Location in ts-app container: /SETUP/ldap/properties
    • Location in ts-utils container: /opt/WebSphere/CommerceServer90/components/ldap/properties
  2. Update the vmm.properties file with the required LDAP information.
    For example:
    #
    # -----------------------------------------------------------------
    # Licensed Materials - Property of HCL Technologies
    #
    # HCL Commerce
    #
    # (C) Copyright HCL Technologies Limited 1996, 2020
    # -----------------------------------------------------------------
    #
    # LDAP server type
    #     Accepted values: (IDS, DOMINO, SUNONE, AD, NDS, CUSTOM)
    #         IDS = IBM Security Directory Server
    #         DOMINO = IBM Lotus Domino
    #         SUNONE = Sun Java System Directory Server
    #         AD = Microsoft Windows Active Directory
    #         NDS = Novell Directory Services
    #         CUSTOM=A custom Directory Server
    #--------------------------------------------------------
    vmm.ldapType=IDS
    
    # Fully qualified LDAP server host name or IP address
    #--------------------------------------------------------
    vmm.ldapHost=123.456.789.210
    
    # LDAP server port number
    #--------------------------------------------------------
    vmm.ldapPort=389
    
    # Specifies whether the LDAP server requires an SSL connection
    
    # 	Accepted values are: (true, false)
    #--------------------------------------------------------
    vmm.ldapWithSSL=false
    
    # The keystore file path for SSL commnication to LDAP
    #--------------------------------------------------------
    vmm.keystorePath=
    
    # The keystore password 
    # (To avoid decrypting warnings in the log, it is strongly recommended to use 
    # the ASCII encrypted string generated from the <WCInstallDir>/bin/wcs_encrypt.bat 
    # command without the merchant key option.)
    #--------------------------------------------------------
    vmm.keystorePassword=
    
    # LDAP search base distinguished name, must be lower case
    #--------------------------------------------------------
    vmm.baseDN=o=root organization
    
    # LDAP bind distinguished name, must be lower case
    #--------------------------------------------------------
    vmm.bindDN=cn=root
    
    # LDAP bind password XOR encoded by WAS PropFilePasswordEncoder utility
    # For example: {xor}Lz4sLChvLTs=
    #
    # Needed for Runtime Environment.
    #--------------------------------------------------------
    vmm.xorBindPassword={xor}Lz4sLChvLTs=
    
    # LDAP bind password
    # (To avoid decrypting warnings in the log, it is strongly recommended to use 
    # the ASCII encrypted string generated from the <WCInstallDir>/bin/wcs_encrypt.bat 
    # command without the merchant key option.)
    #
    # Needed for Development Environment.
    #--------------------------------------------------------
    vmm.bindPassword=MVDKlJXqsnF6jaJjqJFu0+EaHcS1e7lZc1Iran+Ms8Q=
    
    # A full DN that maps to the HCL Commerce root organization; must be lower case.
    #--------------------------------------------------------
    vmm.rootOrgDN=o=root organization
    
    # A full DN that maps to the HCL Commerce default organization; must be lower case.
    #--------------------------------------------------------
    vmm.defaultOrgDN=o=default organization,o=root organization
    
    # Specifies the property names to use to log into the application server.
    # This field takes multiple login properties, delimited by a semicolon (;).
    # For example, uid;mail. All login properties are searched during login.
    # If multiple entries or no entries are found, an exception is thrown.
    # For example, if you specify the login properties as uid;mail and the login ID as Bob,
    # the search filter searches for uid=Bob or mail=Bob. When the search returns a single entry,
    # then authentication can proceed. Otherwise, an exception is thrown.
    #--------------------------------------------------------
    vmm.ldapLoginProp=uid
    
    # The realm name, default to WC_<instanceName>_Realm.
    #--------------------------------------------------------
    vmm.realmName=myrealm
    
    # The primary admin user id for the administrative security.
    # If global security is already enabled, input the primary user
    # currently using.
    # Otherwise, input a user which does not exist in the federated
    # repositories, the tool will create it into the WebSphere Application
    # Server built-in file base user repository.
    #--------------------------------------------------------
    vmm.primaryAdminId=configadmin
    
    # The primary admin user password for the administrative security.
    # (To avoid decrypting warnings in the log, it is strongly recommended to use 
    # the ASCII encrypted string generated from the <WCInstallDir>/bin/wcs_encrypt.bat 
    # command without the merchant key option.)
    #
    # This is used by Toolkit.  In Runtime, it's retrieved from a local file
    #--------------------------------------------------------
    vmm.primaryAdminPwd=Ntjz8goyUYB8qplNy78MOBiIbv9pKAviyQYk5S/O6xY=
    
    # The Commerce test server name on toolkit, 
    # Old name: WebSphere Commerce Test Server
    # New name: HCL Commerce Test Server 
    # The default name is HCL Commerce Test Server, if you use the old test server name, 
    # please set the property to the old name.
    #--------------------------------------------------------
    commerceTestServerName=WebSphere Commerce Test Server
    
    # LDAP user search filter, needed when vmm.ldapType=CUSTOM
    #--------------------------------------------------------
    vmm.ldapUserFilter=(&(uid=%v)(objectclass=inetOrgPerson))
    
    # LDAP user prefix, needed when vmm.ldapType=CUSTOM
    (for example, uid)
    #--------------------------------------------------------
    vmm.userPrefix=uid
    
    # LDAP organization prefix (for example, o)
    # Needed when vmm.ldapType=CUSTOM
    #--------------------------------------------------------
    vmm.orgPrefix=o
    
    # LDAP organizational unit prefix, needed when vmm.ldapType=CUSTOM
    # (for example, ou)
    #--------------------------------------------------------
    vmm.orgUnitPrefix=ou
    
    # LDAP user object class, needed when vmm.ldapType=CUSTOM
    # (for example, inetOrgPerson)
    #--------------------------------------------------------
    vmm.userObjClass=inetOrgPerson
    
    # LDAP organization object class, needed when vmm.ldapType=CUSTOM
    # (for example, organization)
    #--------------------------------------------------------
    vmm.orgObjClass=organization
    
    # LDAP organizational unit object class, needed when vmm.ldapType=CUSTOM
    # (for example, organizationalUnit)
    #--------------------------------------------------------
    vmm.orgUnitObjClass=organizationalUnit
    
    # LDAP administrator distinguished name 
    # @deprecated
    #--------------------------------------------------------
    vmm.ldapAdminDN=
    
    # LDAP administrator password
    # (To avoid decrypting warnings in the log, it is strongly recommended to use 
    # the ASCII encrypted string generated from the <WCInstallDir>/bin/wcs_encrypt.bat 
    # command without the merchant key option.)
    # @deprecated
    #--------------------------------------------------------
    vmm.ldapAdminPassword=
    
  3. Enable LDAP in the database by completing the following steps:
    1. Copy the vmm.properties file to the utilities container.
      For example:
      docker cp vmm.properties bvt_utils_1:/opt/WebSphere/CommerceServer90/components/ldap/properties

    2. Run the following command to enable LDAP in the database:
      ./config_ant.sh -buildfile ../components/common/xml/enableFeature.xml -DWCInstallDir=/opt/WebSphere/CommerceServer90 -DinstanceName=demo -DfeatureName=ldap   -DdbType=<dbType>  -DdbHostname=<dbHost>  -DdbName=<dbName> -DdbServerPort=<dbPort> -DdbUserName=<dbUserName> -DdbUserPassword=<dbUserPassword> -DdbaName=<dbaName> -DdbaPassword=<dbaPassword> -DschemaName=<schemaName> -DjdbcDriver=<jdbcDriver> -DjdbcDriverLocation=<jdbcDriverLocation> -DjdbcURL=<jdbcUrl> Dloggerconfigfile=/opt/WebSphere/CommerceServer90/instances/demo/xml/loader/WCALoggerConfig.xml -Derrordirectory=/opt/WebSphere/CommerceServer90/instances/demo/logs
      For example:
      ./config_ant.sh -buildfile ../components/common/xml/enableFeature.xml -DWCInstallDir=/opt/WebSphere/CommerceServer90 -DinstanceName=demo -DfeatureName=ldap   -DdbType=db2  -DdbHostname=db  -DdbName=mall -DdbServerPort=50000 -DdbUserName=wcs -DdbUserPassword=wcs1 -DdbaName=db2inst1 -DdbaPassword=diet4coke -DschemaName=wcs -DjdbcDriver=com.ibm.db2.jcc.DB2Driver -DjdbcDriverLocation=/opt/WebSphere/CommerceServer90/lib/db2jcc4-4.19.26.jar -DjdbcURL=jdbc:db2://db:50000/mall -Dloggerconfigfile=/opt/WebSphere/CommerceServer90/instances/demo/xml/loader/WCALoggerConfig.xml -Derrordirectory=/opt/WebSphere/CommerceServer90/instances/demo/logs
  4. Build the customized ts-app docker image to enable LDAP by completing the following steps:
    1. Add enable LDAP to custConfiguration.sh.
      For example:
      #!/bin/bash
      /SETUP/bin/enableLDAP.sh
      
    2. Complete the following changes in the Docker file:
      • Copy vmm.properties file to /SETUP/ldap/properties.
      • Copy custConfiguration.sh to /SETUP/bin/custConfiguration.sh.
      • Change the permissions for the file to 755.
      For example:
      COPY vmm.properties /SETUP/ldap/properties
      COPY custConfiguration.sh /SETUP/bin
      RUN chmod 755 /SETUP/bin/custConfiguration.sh
      
    3. Build the customized ts-app Docker image.

Results

WebSphere Application Server Administrative Security with Federated Repositories is now configured.