Steps for extending the Websphere Portal login/logout procedure

As mentioned in my previous post, WebSphere portal executes certain login / logout commands when users login /logout to the portal server.

So the question here is can we extend or modify these default command classes to meet our business requirements and the answer is "Yes" we can.

The command classes define several methods that are called during execution of the command. So we need to simply override these default methods to extend this mechanism. These commands works as below: 
LoginUser.execute()
{
Step1: doPreLogin() // Empty in default command
Step2: doAuthenticate() // Step 1-3 of the login sequence (See previous post)
Step3: doPostLogin() // Step 4 of the login sequence 
Step4: Redirection // Step 5 of the login sequence 
Step5: onAuthenticationError() // only in case of an authentication error
}

LogutUser.execute()
{
Step1: doPreLogout() // Step 1 of the logout sequence (See previous post)
Step2: PortletLogout // Step 2 of the logout sequence
Step3: doPostLogout() // Step 3 of the logout sequence
Step4: Redirection // Step 4 of the logout sequence
Step5: onUserSessionTimeOut() // only in case of an user session timeout
}

In order to modify or extend these sequences, derive a child command (class) from com.ibm.wps.engine.LoginUserAuth (or com.ibm.wps.engine.LogoutUserAuth) and overwrite the respective methods.

No comments:

Post a Comment