WebSphere Commerce EnterpriseWebSphere Commerce Professional

Adding support for auto-logon

To support the autologon feature, you must declare your web application using the com.ibm.eswe.workbench.WctWebApplication extension point and ensure that your URL provider provides auto logon support. The AutoLogonUrlProvider class is provided as a convenient super class for a URL provider that supports auto-logon.

About this task

If you are subclassing AutoLogonUrlProvider then you will need to provide an implementation for the constructAutoLogonUrl method to provide a URL that will handle logon. If the application is authenticating with the WebSphere Commerce Server, then this method must obtain the single sign-on token from the server and add it to the URL as a URL parameter with the parameter name SSOToken. To obtain the single sign-on token you can use the get SSO Token service request. The following sample code will invoke the service request to retrieve the single sign-on token from the WebSphere Commerce Server:


String token = null;
try {
//Try to get the SSO token
TelesalesJobScheduler scheduler =
TelesalesJobScheduler.getInstance();
TelesalesRequestStatus status =
scheduler.run("com.ibm.commerce.telesales.GetSSOTokenRequest",
null, true);
TelesalesJobScheduler.handleErrors(status);
token = (String) status.getData();
}
catch(Exception e) {
UIImplPlugin.log(e);
}