Enabling single sign-on
Enabling single sign-on (SSO) preserves user authentication on different web Applications in WebSphere Commerce. By using HTTP single sign-on, the user is not prompted multiple times for security credentials within a trust domain.
Before you begin
- Install and configure an LDAP server. To configure an LDAP server see Preparing the LDAP server for use with WebSphere Commerce.
- Enable WebSphere Application Server security with Federated Repositories.
- Modify the WebSphere Commerce
configuration file. If WebSphere Commerce switches to a single
sign-on environment when there is shopper information in the WebSphere
Commerce database, ensure that the
MigrateUsersFromWCSdb
flag is set toON
. - Synchronize the system clocks of all the systems that are included in the single sign-on configuration.
Procedure
-
Configure single sign-on using the WebSphere Commerce Integration
Wizard.
-
Ensure that the WebSphere Application Server is in the
following state.
- Ensure that the WebSphere Application Server is started.
- WebSphere Application Server is not started.
Note: If the database hostname is recently changed, ensure that following files are updated with the hostname information so that the WebSphere Commerce Integration Wizard can locate the database.- WC_installdir/instances/instance_name/xml/instance_name.xml
- WC_installdir/instances/instance_name/properties/createInstance.properties
-
Open the WebSphere
Commerce Integration Wizard.
- WC_installdir/bin/WCIntegrationWizard.sh
- WC_installdir\bin\WCIntegrationWizard.bat
- WCDE_installdir\bin\WCIntegrationWizard.bat
- Verify the prerequisites. Click Next.
- Select your WebSphere Commerce instance name. Enter and confirm your database password. Click Next.
- Select Single Sign On as the integration task. Click Next.
-
Enter the information specific to your single sign-on
configuration.
- Enter your single sign-on domain name.
- Select Configure JAAS Login Module if you want WebSphere Commerce to generate the LTPA token.
Each field is described in the WC_installdir/components/sso/properties/ltpa.properties file.
If you did not select the option to Configure JAAS Login Module, you can enable this configuration later by updating the security.xml file:- Navigate to the following
directory:
WAS_profiledir/config/cells/host_name
- Open the security.xml file for editing.
- Add the following
<entries>
to the file within the<applicationLoginConfig>
element:<applicationLoginConfig> <entries xmi:id="JAASConfigurationEntry_1210305965219" alias="WCLogin"> <loginModules xmi:id="JAASLoginModule_1210305989406" moduleClassName="com.ibm.ws.security.common.auth.module.proxy.WSLoginModuleProxy" authenticationStrategy="REQUIRED"> <options xmi:id="Property_1210305989406" name="delegate" value="com.ibm.ws.security.server.lm.ltpaLoginModule"/> </loginModules> <loginModules xmi:id="JAASLoginModule_1210306090375" moduleClassName="com.ibm.ws.security.common.auth.module.proxy.WSLoginModuleProxy" authenticationStrategy="REQUIRED"> <options xmi:id="Property_1210306090375" name="delegate" value="com.ibm.ws.security.server.lm.wsMapDefaultInboundLoginModule"/> <options xmi:id="Property_1210306102953" name="cookie" value="true" required="false"/> </loginModules> </entries> </applicationLoginConfig>
- Restart the server.
- Click Next and verify the summarized information.
- Click Next > Finish to complete the WebSphere Commerce Integration Wizard.
-
Verify that the configuration is complete by searching for the Feature
'ldap','sso' enablement completed sucessfully. string in the log file:
- WCDE_installdir/logs/enableFeature.log
- WC_installdir/instances/instance_name/logs/enablesso_time.log
Important: Ensure that you add create/search/read/write permissions to the DNBind user after single sign-on is enabled. This permission ensures access to the tool pages. -
Ensure that the WebSphere Application Server is in the
following state.
-
Copy and modify the components/sso/properties/ltpa.properties file.
- Copy the components/sso/properties/ltpa.properties file to the following directory: WC_installdir/instance_name/properties/ltpa.properties[WebSphere Commerce Developer] WCDE_installdir\setup\ltpa.properties.
-
Modify the file.
Sample values are shown in this example:
#-----------------------------------------------------------------# Licensed Materials - Property of IBM # # WebSphere Commerce # # (C)Copyright IBM Corp. 2006, 2010 All Rights Reserved. # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with # IBM Corp. #----------------------------------------------------------------- # The authentication mechanism for Single Sign-On # Accepted values are: ltpa #-------------------------------------------------------- sso.authMode=ltpa # LTPA 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.) #-------------------------------------------------------- sso.ltpaPassword=EaDPFd9VAf0= # Specifies whether this tool should import or export the LTPA key file? # Accepted values are: import,export #-------------------------------------------------------- sso.ltpaFileAction= # Single Sign-On domain name# For example,acme.com #-------------------------------------------------------- sso.ssoDomain=acme.com # LTPA key file path #-------------------------------------------------------- sso.ltpaKeyPath= # Need to configure Java Authentication and Authorization Service. (Accepted values are: true/false) # Only set to true if you want to generate LTPA token from WebSphere Commerce. # Defaults to false. #-------------------------------------------------------- sso.configureJAAS=false
-
Open a command prompt, and run the following command:
config_ant.bat -buildfile WC_installdir/components/common/xml/enableFeature.xml -DinstanceName=instance_name -DfeatureName=sso -DdbUserPassword=db_password [WebSphere Commerce Developer] enableFeature.bat -DfeatureName=sso
- Generate and
export the key file for WebSphere Commerce.
- Log on as one of the following
users:
- non-root user.
- user with administrative authority.
- Ensure that the WebSphere Application Server is started.
- Open the WebSphere Application Server Administration Console.
- Expand the Security node. Click Global Security.
- In the Authentication section, ensure that the radio button for LTPA is selected. Click LTPA.
- In the Cross-cell single sign-on section, enter and verify the password for the LTPA token that you are exporting.
- Enter the Fully qualified key file name. This name is the directory location and file name for the key file that must be imported to the server for the other application. Click Export.
- Click Apply > Save directly to the master configuration.
- Go to the directory that you specified for the key file and verify that the key is generated.
- Copy this exported key file from the WebSphere Commerce file system and import the key into the file system of the server for the other application.
- Log on as one of the following
users:
- Configure the LTPA token so that it flows over only SSL
to ensure the security of your site.
- In the WebSphere Application Server administrative console, expand the Security node. Click Global Security.
- In the Authentication section, expand Web and SIP security. Click Single sign-on (SSO).
- Select the Requires SSL check box.
- Click Apply > Save directly to the master configuration.
- Import the key file from the other
application into WebSphere Commerce.
- Copy the generated file key from the file system of the server for the application to the file system of the server for WebSphere Commerce.
- In the WebSphere Application Server administrative console, expand the Security node. Click Global Security.
- In the Authentication section, click LTPA.
- In the Cross-cell single sign-on section, enter and verify the password for the LTPA token that you are importing.
- Enter the Fully qualified key file name for the key file that you copied from the file system of the other application. Click Import keys.
- Click Apply> > Save directly to the master configuration.
- Restart the servers for WebSphere Commerce and the other application.
- Configure the roles that are assigned
to users that access the system from single sign-on (SSO). Every time a user connects to the system by SSO, WebSphere Commerce tries to assign the roles from the
MemberRegistrationAttributes.xml
file with registration type = "SSO".For more information, see MemberRegistrationAttributes XML and DTD files.
In WebSphere Commerce, security roles are assigned as part of the registration process. With single sign-on, the customer can bypass the registration step for your site if they have successfully authenticated to a collaborating system. The ability to be implicitly authenticated to a WebSphere Commerce site has little value when a user is denied access to the facilities that they want to use, such as shopping in a store. Therefore, the same functionality of automated role assignment that happens with user registration also happens in the session management code. In this case, configure the roles for SSO shoppers by using the 'SSO' registration type. This way, when a customer authenticates onto the system, WebSphere Commerce automatically provides all of the roles that they need for the site. Keep in mind that the SSO role assignment happens on a site level and not on a store level (as with the typical user registration). Therefore, ensure that the storeAncestor attribute specified is actually an ancestor of the site (store 0).
- Enable single sign-on for Management Center.
- Navigate to the following directory:
- WC_installdir/LOBTools.war/WEB-INF
- workspace_dir\LOBTools\WebContent\WEB-INF
- Open the struts-extension.xml file for editing.
- If the single sign-on actions for Management Center are
commented out, uncomment the sections of code.
ResolveIdentify
- this action is for resolving the identity of users by using theauthenticateLTPA
service.<action path="/ResolveIdentity" parameter="Person" type="com.ibm.commerce.foundation.client.lobtools.actions.AuthenticationClientLibraryAction" className="com.ibm.commerce.foundation.client.facade.bod.servlet.struts.BusinessObject DocumentActionMapping"> <set-property property="contextParameters" value="channelId" /> <set-property property="clientLibrary" value="com.ibm.commerce.member.facade.client.MemberFacadeClient" /> <set-property property="clientLibraryMethod" value="authenticateLTPA" /> <forward name="success" path="/jsp/commerce/shell/restricted/ResolveIdentitySuccess.jsp"> </forward> <forward name="failed" path="/jsp/commerce/shell/restricted/ResolveIdentityFailed.jsp"> </forward> </action>
Logon
- this action is for generating an LTPA token when a user logs on to Management Center. If this action does not display within the struts-extension.xml file, add this action.<action path="/Logon" parameter="Person" type="com.ibm.commerce.foundation.client.lobtools.actions.AuthenticationClientLibraryAction" className="com.ibm.commerce.foundation.client.lobtools.actions.AuthenticationActionMapping"> <set-property property="contextParameters" value="channelId" /> <set-property property="clientLibrary" value="com.ibm.commerce.member.facade.client.MemberFacadeClient" /> <set-property property="clientLibraryMethod" value="authenticatePassword" /> <set-property property="aliasParameters" value="password:logonPassword" /> <set-property property="generateLTPAToken" value="true" /> <forward name="success" path="/jsp/commerce/shell/restricted/AuthenticationSuccess.jsp"> </forward> <forward name="failed" path="/jsp/commerce/shell/restricted/AuthenticationFailed.jsp"> </forward> </action>
Logout
- this action is for removing the generated LTPA token when a user logs out of Management Center. If this action does not display within the struts-extension.xml file, add this action.<action path="/Logout" parameter="Person" type="com.ibm.commerce.foundation.client.lobtools.actions.AuthenticationClientLibraryAction" className="com.ibm.commerce.foundation.client.lobtools.actions.AuthenticationActionMapping"> <set-property property="clientLibrary" value="com.ibm.commerce.member.facade.client.MemberFacadeClient" /> <set-property property="clientLibraryMethod" value="logout" /> <set-property property="removeLTPAToken" value="true" /> <forward name="success" path="/jsp/commerce/foundation/restricted/Values.jsp"> </forward> <forward name="failed" path="/jsp/commerce/shell/restricted/AuthenticationFailed.jsp"> </forward> </action>
- Save your changes and close the file.
- Navigate to the following directory:
- Optional:
If you configured WebSphere Commerce to generate the LTPA token
(previously selected Configure JAAS Login Module), you must update the
properties for the LogonCmd, UserRegistrationAddCmd,
PersonProcessServicePersonRegister, and LogOffCmd.
-
Navigate to the following directory:
- WC_eardir/Stores.war/WEB-INF
- workspace_dir/wc/Stores.war/WEB-INF
- Open the struts-config-ext.xml file for editing.
-
Locate the following code snippet for the logon command:
Add the following<action parameter="com.ibm.commerce.security.commands.LogonCmd" path="/Logon" type="com.ibm.commerce.struts.LTPATokenGenerationEnabledBaseAction">
generateLTPAToken
property to the action parameter:
Where<!-- The store will create LTPA the token on logon --> <set-property property="generateLTPAToken" value="10101:1"/>
10101
represents your store ID. -
Locate the following code snippet for the UserRegistrationAddCmd
command:
Add the following<action parameter="com.ibm.commerce.usermanagement.commands.UserRegistrationAddCmd" path="/UserRegistrationAdd" type="com.ibm.commerce.struts.LTPATokenGenerationEnabledBaseAction">
generateLTPAToken
property to the action parameter:
Where<!-- The store will create LTPA the token on registration --> <set-property property="generateLTPAToken" value="10101:1"/>
10101
represents your store ID. -
Locate the following code snippet for the PersonProcessServicePersonRegister
command:
Add the following<action parameter="member.registerPerson" path="/PersonProcessServicePersonRegister" type="com.ibm.commerce.struts.LTPATokenGenerationEnabledComponentServiceAction">
generateLTPAToken
property to the action parameter:
Where<!-- The store will create LTPA the token on registration --> <set-property property="generateLTPAToken" value="10101:1"/>
10101
represents your store ID. -
Locate the following code snippet for the logoff command:
Add the following<action parameter="com.ibm.commerce.security.commands.LogoffCmd" path="/Logoff" type="com.ibm.commerce.struts.LTPATokenGenerationEnabledBaseAction">
removeLTPAToken
property to the action parameter:
Where<!-- The store will destroy/remove the LTPA token on logoff --> <set-property property="removeLTPAToken" value="10101:1"/>
10101
represents your store ID.
-
Navigate to the following directory:
- Optional: If LTPA tokens
are being used, it is possible to allow them to keep a session alive
beyond the standard WebSphere Commerce session timeout. The LTPA token
is only checked when the session is expired. If valid it refreshes
the session.
- Navigate to the following directory:
- WC_eardir/xml/config/
- workspace_dir\WC\xml\config\
- Open the wc-server.xml file for editing.
- Change the value of keepAliveSession to true,
as highlighted in the following code:
<MemberSubSystem AuthenticationMode="LDAP" ProfileDataStorage="LDAP"> <Directory EntryFileName="ldap/ldapentry.xml" MigrateUsersFromWCSdb="ON" SingleSignOn="1" display="false" keepAliveSession="true"/> <SyncOrganizationWxclusionList display="false"/> <ResetPassword resetNullPasswordEnabled="true"/>
- Save and close the file.
- Navigate to the following directory:
- Deploy your changes to the WebSphere Commerce enterprise archive (EAR).
- Restart the WebSphere Application Server.