Introduced in Feature Pack 2

Customizing web feed integration: Support a custom authentication mechanism

The web feed integration feature provides basic authentication, with or without SSL, and client certificate authentication with SSL. If your CMS system does not support these types, you can extend the authentication framework.

Procedure

  1. Open WebSphere Commerce Developer.
  2. Depending on your business requirements, do one of the following steps:
    1. Generate a custom business object mediator using the data load framework.
    2. Use an existing business object mediator.
  3. Locate the WebSphereCommerceServerExtensionsLogic project. Add the files Foundation-DataLoad-FEP.jar and Foundation-DataLoad.jar to the build path of the project. Add any other dependent JAR files to the classpath.
  4. In the WebSphereCommerceServerExtensionsLogic project, create a Java class that extends com.ibm.commerce.foundation.dataload.http.CustomAuthHTTPConnector.
  5. Override the required method, public abstract HttpClient createHttpClient()throws HTTPConnectionException; to support the new authentication mechanism. This class can also use parameters supplied in the feed configuration file. To use these properties, use the following code template: getConfigProperties().getKey("name1");
  6. Package the custom authentication class and helper classes in the WebSphereCommerceServerExtensionsLogic project to a JAR file.
  7. If it does not exist, create the WCDE_installdir\ext\lib directory.
  8. Copy the JAR file to the WCDE_installdir\ext\lib directory.
    Custom JAR files are placed in this directory.
  9. In the Web-feed-config.xml file to specify the custom authentication class and its properties.
    <?xml version="1.0" encoding="UTF-8"?>
    <config:CMSConfiguration>
    	....
    	<config:feedEndPoint>
    		<config:content>
    			....
    		</config:content>
    		<!-- If the web feeds are secure, specify the security related information here. -->
    			<config:securityConfiguration>
    			<!-- When the system generating feeds uses an authentication
                         mechanism other than basic authentication and client certificate authentication, 
    			a custom authentication type needs to be specified. -->
    			<config:customAuth>
    				<!-- This is the name of the custom authenticator class that 
                                extends the abstract class CustomAuthHTTPConnector. 
    				This class must be available in the classpath. -->
    				<config:handler>Class Name of your custom authentication class 
                                goes here...</config:handler>
    				<!-- List of name-value pairs that need to be supplied to
                                the custom authenticator -->
    				<config:property name="name1" value="value1"/>
    				<config:property name="name2" value="value2"/>
    			</config:customAuth>
    			<!-- Use SSL configuration, if required. -->
    			<config:SSLConfiguration>
    					...
    			</config:SSLConfiguration>
    		</config:securityConfiguration>
    	</config:feedEndPoint>
    	....
    	<config:dataLoadConfigFile generate="true" envFileLocation=
           "test-dataload-env.xml">/temp/wc-dataload-config.xml</config:dataLoadConfigFile>
    </config:CMSConfiguration>