Tuesday, March 10, 2009

IBM Portal login mechanism analysis and examples

1. Preface
On the portal log in custom development, project developers are often encountered problem. Log in to the portal, however the mechanism is not understood, a direct result of increased development of the difficulty, or even can not be achieved. Based on the default portal (Form) way to elaborate portal log mechanism, and illustrates some practical projects sign the application of a modified form.

2. Portal Login mechanism
Portal is set up at WAS on the application for certification to provide this piece from the WAS, Login portlet just call WAS certification services to certification, the certification services that are packaged into the portal application services. Projects in the general case, a gateway to all external LDAP server, the portal by configuring bind LDAP, portlet authentication is essentially the interface to call the LDAP does not make any verification operation, and if there is abnormal generation, log interface put information is displayed.


LDAP From the previous chart we can see that by the portlet log user name and password, call the portal to complete the certification services certification function, and certification services can only be easy to configure the call to authenticate the LDAP interface.
, Of course, each deal with the safety standards have a lot of JAVA Supported details here do not give a more detailed explanation. Since the actual modifications in-depth understanding of these is not a necessity, here are proceeding from reality and can modify these lines. If you want to understand the specific details, you can see the WAS security and safety information portal.

2.1 LDAP Authentication
If the instrument used LDAP, you know, to connect LDAP using the user's full name such as "cn = wpsadmin, dc = ibm, dc = com", re-use a password in order to connect successfully. wpsadmin,LDAP At the portal to connect LDAP configuration when a filter, you need to do is enter wpsadmin, through the filter will match the full name out, so that LDAP authentication. Detailed configuration information can refer to documents PORAL_SERVER \ config \ wpconfig.properties. Gateway configuration file contains the LDAP authentication information, management group, the administrator's name and so on. If the UI to configure the security, the system will write information to the user's configuration file, and then call the update command. Of course, we can directly modify the configuration information file, run the update configuration command.
LDAP authentication portals are the ultimate way of certification, of course, a gateway sign at the time have to deal with other treatment, for example, will have a successful log in LTPA Cookie, the failure of certification will be thrown out the causes of the failure of information and so on. Like to stress here, the authentication when LDAP authentication, portal applications deal with only a supplementary role.

2.2 Login Portlet
Sign in for portlet (login.war), it is a form of information to verify the application of its core function is to check user input through the user name and password, to determine whether users are legitimate; are legitimate users, once confirmed, the deal Backgrounds End of log-related information, go to fit the pagego; if it is not legitimate users, then Jump to the importation of information form, show the error message. This process is quite simple, the code logic is quite simple.
The following description of the portlet on to the two aspects: First, log in the view, that is, the display jsp; Second, for the treatment of the log information, that is, category portlet.

1) Login Portlet's view.
On view at the main page has two elements, first, error information pages, the second is to submit the information form. Showing page information is contained in LoginView.jsp above StatusMessageInclude.jspf, when there is validation error (wrong return generated by the treatment Login.class) log back page shows the type of error and error message.
In addition, the sign at the JSP-ri, form has the following parameters:

Parameters Must Value
userid userid Yes User Name
Password Password Yes Password
WPSRedirectURL WPSRedirectURL
No
URL Sign of the URL after the Jump
selectionID selectionID
No
ID Jump page after log in ID

From the table, it is clear the usage of the various parameters, in accordance with specific parameters to complete a number of functions, such as customized want to log in after the Jump page, you can set up WPSRedirectURL or selectionID (at the portal customization page where ID) value, but another perspective, however, must sign the form in containing userid and password fields.

2) Login portlet
Login portlet, mainly on mass information from the form for validation, the core of the method are doLogin by processAction call. Inside a package called portal to carry out the certification services certification, but also deal with the case thrown out based on a variety of error messages.
SUMMARY know the following certification under the Code deal with the process of treatment at the former code, the main definition of the environment variable:
private static com.ibm.portal.portlet.service.login.LoginHome loginHome = null; private static com.ibm.portal.portlet.service.login.LoginHome loginHome = null;
private static com.ibm.portal.state.service.PortletStateManagerService portletStateManagerService = null; private static com.ibm.portal.state.service.PortletStateManagerService portletStateManagerService = null;
private static com.ibm.portal.portletservice.rememberme.RememberMeCookieService rememberMeCookieService = null; private static com.ibm.portal.portletservice.rememberme.RememberMeCookieService rememberMeCookieService = null;
private static com.ibm.portal.portlet.service.model.PortletLocalizedContextHome localizedContextHome; private static com.ibm.portal.portlet.service.model.PortletLocalizedContextHome localizedContextHome;
: Processing code is as follows:
1. In the init method to initialize portal certification services
InitialContext initialcontext = new InitialContext(); InitialContext initialcontext = new InitialContext ();
com.ibm.portal.portlet.service.PortletServiceHome portletservicehome = (com.ibm.portal.portlet.service.PortletServiceHome)initialcontext.lookup("portletservice/com.ibm.portal.portlet.service.login.LoginHome"); com.ibm.portal.portlet.service.PortletServiceHome portletservicehome = (com.ibm.portal.portlet.service.PortletServiceHome) initialcontext.lookup ( "portletservice / com.ibm.portal.portlet.service.login.LoginHome");
loginHome = (com.ibm.portal.portlet.service.login.LoginHome)portletservicehome.getPortletService(com.ibm.portal.portlet.service.login.LoginHome); loginHome = (com.ibm.portal.portlet.service.login.LoginHome) portletservicehome.getPortletService (com.ibm.portal.portlet.service.login.LoginHome);
JNDIportletportletservicehome Above through the JNDI interface code has been portlet authentication service portletservicehome.

2. 2. processActiondoLogin Ways processAction put in a username and password to doLogin Ways to verify.
boolean flag = doLogin(username, pwd, booleanvalue, actionrequest, actionresponse); boolean flag = doLogin (username, pwd, booleanvalue, actionrequest, actionresponse);
true,false(doLogin) Return true if authentication is successful, false if we should jump back to the importation of the page displays an error message (which deal with information at the time doLogin add).

3. 3. doLogin doLogin certification are the main
com.ibm.portal.portlet.service.login.LoginService loginservice = loginHome.getLoginService(actionrequest, actionresponse); com.ibm.portal.portlet.service.login.LoginService loginservice = loginHome.getLoginService (actionrequest, actionresponse);
loginservice.login(username, pwd.toCharArray(), hashmap, null); loginservice.login (username, pwd.toCharArray (), hashmap, null);
These are called certification services certified loginservice code, from here to see if the deal with the user's password checking process, because of its package to the certification process has already gone Services, in fact, we are unnecessarily concerned about this detail.
login portlet Emphasize here that the login portlet mechanism of abnormal information. Ways at doLogin catch, and then came out abnormal information log page display: treatment such as the following code:
catch (com.ibm.portal.auth.exceptions.UserIDInvalidException useridinvalidexception) catch (com.ibm.portal.auth.exceptions.UserIDInvalidException useridinvalidexception)
{ (
obj = new WpsException(com.ibm.wps.portlets.login.LoginMessages.USER_ID_INVALID_0, null, useridinvalidexception); obj = new WpsException (com.ibm.wps.portlets.login.LoginMessages.USER_ID_INVALID_0, null, useridinvalidexception);
actionresponse.setRenderParameter(" wps .portlets.login.status_message_details", com.ibm.wps.portlets.login.Login.getStackTraceAsString(useridinvalidexception)); actionresponse.setRenderParameter ( "wps. portlets.login.status_message_details", com.ibm.wps.portlets.login.Login.getStackTraceAsString (useridinvalidexception));

} )
From the above code from decompile, is dished out username unlawful abnormal, unusual information and then assign values to variables "wps.portlets.login.status_message_details" go to the page display. Apart from this anomaly have other unusual things such as turn off portlet log abnormal PortletLoginDisabledException, wrong password error message abnormal abnormal PasswordInvalidException and so on. Under normal circumstances, a modified log portlet will not show these information to the page, but the output to the log-ri. In the information displayed to the user's log are incorrect, but the anomalies have a different background information. For the treatment of abnormal information are customized sign an important component of the portlet. How to construct the wrong kind of information and get easy access to background information in a variety of errors, are customized portlet sign the deal with one of the key points.

2.3 Portal Services Certification
At default, the authentication services are com.ibm.wps.engine.commands.LoginUserAuth, it is inherited com.ibm.wps.engine.commands.LoginUser. It is to achieve the following flow:
1. WAS,WASLDAP, WAS log, WAS through LDAP bind authentication enter the username and password and save it to put the client certificate.
2. Portal JAAS Login, Register the implementation of all the JAAS Modules, save all the user's certificate and commissioned in the user session.
3. Portal Login, Portal to the user's primary user information (LDAP or database existence of personal information) is loaded to the portal server.
4. To resume the conversation, if the permit is to restore the gateway to the final conversation.
5. Jump, Jump to fit the page.
These have been packaged into com.ibm.wps.engine.commands.LoginUser flow, the general, the user's custom categories are inherited it to achieve custom functionality.
The following are the norms of custom authentication service code:
public class LoginUserAuth extends com.ibm.wps.engine.commands.LoginUser public class LoginUserAuth extends com.ibm.wps.engine.commands.LoginUser
{ (
/** / **
** Can be overridden by derived classes to extend (or disable) the login mechanism. ** Can be overridden by derived classes to extend (or disable) the login mechanism.
** **
** This method will be called on each login attempt, before the user authentication. ** This method will be called on each login attempt, before the user authentication.
** **
** @param com.ibm.wps.engine.RunData ** @ Param com.ibm.wps.engine.RunData
** the rundata object ** The rundata object
** **
** @param String ** @ Param String
** the userid, "null" if not available ** The userid, "null" if not available
** **
** @param String ** @ Param String
** the user password, "null" if not available ** The user password, "null" if not available
** **
** @throws WpsException, a generic exception. ** @ Throws WpsException, a generic exception.
** If an exception is thrown, the login command will ** If an exception is thrown, the login command will
** fail to execute successfully. ** Fail to execute successfully.
**/ ** /
protected void doPreLogin (RunData aRunData, String aUserID, String aPassword) protected void doPreLogin (RunData aRunData, String aUserID, String aPassword)
throws WpsException throws WpsException
{} ()
protected final static int NO_ERROR = 0; protected final static int NO_ERROR = 0;
protected final static int OTHER_ERROR = 1; protected final static int OTHER_ERROR = 1;
protected final static int USER_RETRIEVE_ERROR = 2; protected final static int USER_RETRIEVE_ERROR = 2;
protected final static int USERID_INVALID_ERROR = 3; protected final static int USERID_INVALID_ERROR = 3;
protected final static int PASSWORD_INVALID_ERROR = 4; protected final static int PASSWORD_INVALID_ERROR = 4;
protected final static int AUTHENTICATION_FAILED_ERROR = 5; protected final static int AUTHENTICATION_FAILED_ERROR = 5;
protected final static int JAAS_LOGIN_FAILED_ERROR = 6; protected final static int JAAS_LOGIN_FAILED_ERROR = 6;
protected final static int RESERVED = 7; protected final static int RESERVED = 7;
protected final static int USER_SESSION_TIMEOUT_ERROR = 8; protected final static int USER_SESSION_TIMEOUT_ERROR = 8;
protected final static int USER_DEFINED_ERROR = 1000; protected final static int USER_DEFINED_ERROR = 1000;
/** / **
** Can be overriden by derived classes to extend (or disable) the login mechanism. ** Can be overriden by derived classes to extend (or disable) the login mechanism.
** **
** This method does the user authentication. The return value is an error code. ** This method does the user authentication. The return value is an error code.
** **
** @param RunData ** @ Param RunData
** the rundata object ** The rundata object
** @param UserID ** @ Param UserID
** the user id ** The user id
** @param Password ** @ Param Password
** the password ** The password
** @return ErrorBean ** @ Return ErrorBean
** The error state. Error code is NO_ERROR if successful. NO_ERROR to ** The error state. Error code is NO_ERROR if successful. NO_ERROR to
** USER_DEFINED_ERROR are reserved codes, custom LoginUser classes must ** USER_DEFINED_ERROR are reserved codes, custom LoginUser classes must
** define error codes higher than USER_DEFINED_ERROR. ** Define error codes higher than USER_DEFINED_ERROR.
**/ ** /
protected ErrorBean doAuthenticate(RunData aRunData, String aUserID, String aPassword) protected ErrorBean doAuthenticate (RunData aRunData, String aUserID, String aPassword)
{ (



} )
/** / **
** Can be overriden by derived classes to extend (or disable) the login mechanism. ** Can be overriden by derived classes to extend (or disable) the login mechanism.
** **
** This method is called if the doAuthenticate() return code is other than NO_ERROR ** This method is called if the doAuthenticate () return code is other than NO_ERROR
** **
** @param RunData ** @ Param RunData
** the rundata object ** The rundata object
** @param ErrorBean ** @ Param ErrorBean
** error state as returned by the doAuthenticate() method ** Error state as returned by the doAuthenticate () method
**/ ** /
protected void onAuthenticationError (RunData aRunData, ErrorBean aErrorBean) protected void onAuthenticationError (RunData aRunData, ErrorBean aErrorBean)
{ (

} )
/** / **
** Can be overridden by derived classes to extend (or disable) the login mechanism. ** Can be overridden by derived classes to extend (or disable) the login mechanism.
** **
** This method is called after a successful user login/authentication, ** This method is called after a successful user login / authentication,
** (ie only if the doAuthenticate() return code is NO_ERROR). ** (Ie only if the doAuthenticate () return code is NO_ERROR).
** **
** @param com.ibm.wps.engine.RunData ** @ Param com.ibm.wps.engine.RunData
** the rundata object ** The rundata object
** **
** @param String ** @ Param String
** the userid, "null" if not available ** The userid, "null" if not available
** **
** @param String ** @ Param String
** the user password, "null" if not available ** The user password, "null" if not available
** **
** @throws WpsException, a generic exception. ** @ Throws WpsException, a generic exception.
**/ ** /
protected void doPostLogin (RunData aRunData, String aUserID, String aPassword) protected void doPostLogin (RunData aRunData, String aUserID, String aPassword)
throws WpsException throws WpsException
{ (

} )
} )

package com.ibm.wps.auth; package com.ibm.wps.auth;
public class ErrorBean public class ErrorBean
{ (
public ErrorBean(int ErrorCode, Exception exception); public ErrorBean (int ErrorCode, Exception exception);
public int getErrorCode(); public int getErrorCode ();
public Exception getException(); public Exception getException ();
} )

package com.ibm.wps.engine; package com.ibm.wps.engine;
public class RunData public class RunData
{ (
// returns the http request object / / Returns the http request object
public HttpServletRequest getRequest (); public HttpServletRequest getRequest ();
// returns the http response object / / Returns the http response object
public HttpServletResponse getResponse (); public HttpServletResponse getResponse ();
// returns the session object, same semantics as HttpServletRequest.getSession / / Returns the session object, same semantics as HttpServletRequest.getSession
public HttpSession getSession (boolean create); public HttpSession getSession (boolean create);
// sends an http redirect with the given status code and URL / / Sends an http redirect with the given status code and URL
// for redirects this method has to be used, you must not use the / / For redirects this method has to be used, you must not use the
// httpResponse.sendRedirect method. / / HttpResponse.sendRedirect method.
public void sendRedirect (int aStatusCode, String aRedirectURL) throws IOException; public void sendRedirect (int aStatusCode, String aRedirectURL) throws IOException;
// returns the portal user object. / / Returns the portal user object.
// To make sure that your code works for all WP 4 releases, call it as follows: / / To make sure that your code works for all WP 4 releases, call it as follows:
// com.ibm.wps.puma.User user = (com.ibm.wps.puma.User) aRunData.getUser (); / / Com.ibm.wps.puma.User user = (com.ibm.wps.puma.User) aRunData.getUser ();
public User getUser (); public User getUser ();
} )

package com.ibm.portal; package com.ibm.portal;
/** / **
* This exception can be used by the customer to create a WPSException * This exception can be used by the customer to create a WPSException
* without a MessageCode. * Without a MessageCode .
*/ * /
public class CustomWpsException extends WpsException public class CustomWpsException extends WpsException
{ (
/** / **
* Construct a new WpsException without parameters - the cause field is not initialized * Construct a new WpsException without parameters - the cause field is not initialized
* The cause may subsequently be initialized via calling the {@link #initCause} method. * The cause may subsequently be initialized via calling the (@ link # initCause) method.
*/ * /
public CustomWpsException(); public CustomWpsException ();
/** / **
* Construct a new WpsException with the cause field * Construct a new WpsException with the cause field
* set to the specified Throwable. Subsequent calls to the {@link #initCause} * Set to the specified Throwable. Subsequent calls to the (@ link # initCause)
* method on this instance will result in an exception. The value of the cause * Method on this instance will result in an exception. The value of the cause
Page 8 Page 8
* field may be retrieved at any time via the {@link #getCause()} method. * Field may be retrieved at any time via the (@ link # getCause ()) method.
* @param cause the Throwable that was caught and is considered the root cause * @ Param cause the Throwable that was caught and is considered the root cause
* of this exception; may be null. * Of this exception; may be null.
*/ * /
public CustomWpsException(Throwable t); public CustomWpsException (Throwable t);
/** / **
* Construct a new WpsException with the specified detail message * Construct a new WpsException with the specified detail message
* - the cause field is not initialized * - The cause field is not initialized
* The cause may subsequently be initialized via calling the {@link #initCause} method. * The cause may subsequently be initialized via calling the (@ link # initCause) method.
* @param message detailed message in form. of a String. * @ Param message detailed message in form. Of a String.
*/ * /
public CustomWpsException(String message); public CustomWpsException (String message);
/** / **
* Construct a new WpsException with the specified detail message and a cause field * Construct a new WpsException with the specified detail message and a cause field
* set to the specified Throwable. Subsequent calls to the {@link #initCause} * Set to the specified Throwable. Subsequent calls to the (@ link # initCause)
* method on this instance will result in an exception. The value of the cause * Method on this instance will result in an exception. The value of the cause
* field may be retrieved at any time via the {@link #getCause()} method. * Field may be retrieved at any time via the (@ link # getCause ()) method.
* @param message detailed message in form. of a String. * @ Param message detailed message in form. Of a String.
* @param cause the Throwable that was caught and is considered the root cause * @ Param cause the Throwable that was caught and is considered the root cause
* of this exception; may be null. * Of this exception; may be null.
*/ * /
public CustomWpsException(Throwable t, String message); public CustomWpsException (Throwable t, String message);
} )

3. Custom sign strategy
Customization of the main sign is divided into three levels, based on the needs of different ways of custom sign. View,portlet,portal Separately for three levels: View layer, portlet customization category, portal customization services. \ \

3.1 View Layer
The view changes to layer, that is a sign display style changes, this is the usual way to amend. login portletLoginView.jsp,At the login portlet in LoginView.jsp page, you can add their own custom show styles, add your own picture or add js code.These customized with Servlet containers generally JSP page or less the same, only the introduction of resources to use the portlet tag, the path of the main resources are different, such as:
String PORTLET_PATH= renderResponse.encodeURL( renderRequest.getContextPath();
String PORTLET_PATH = renderResponse.encodeURL (renderRequest.getContextPath ();
Obtain the current portlet's URL, in this basic portlet can specify on the resources URL.
Experience in order to better effect, usually the introduction of ajax features, this is a more powerful supplement. , Can add such as the submission of the former call sign of the deal with a number of service functions, the user name input validity checking for real-time and so on. For the use of ajax not detailed here, can refer to online resources. ,LoginView.jspportlet Would also like to mention is that if the Verification Code to add sign features such LoginView.jsp and portlet code should be changed do.
Despite the various styles can be modified, but some code can not be altered, and even some of the contents are to retain a large degree. For example the following aspects:
1) In the JSP page in the JAVA code best not to modify, unless a high degree of certainty.
2) form of the action of the URL links and form of user name and password fields.
JSP page has a lot of logic parameters, which include customized functionality, but it's submitted username and password are the most direct function, it is necessary to retain this point.
Unusual treatment for the information, usually on the login portlet in StatusMessageInclude.jspf document changes to the default information display friendly enough. : Usually show abnormal information to amend the following code:
<%=message%>
 <% = message%>

<% <%
// only show details link if there are details to show / / Only show details link if there are details to show
if ( (messageDetails!=null) && if ((messageDetails! = null) & &
(!messageDetails.equals("")) ) { (! messageDetails.equals (""))) (
%> %>
 
<% <%
} // end if (messageDetails!=null) ) / / End if (messageDetails! = Null)
%> %>



<% <%
} // end if message != null ) / / End if message! = Null
%> %>
Above code, in general are showing a error "incorrect username or password, if the recognized input ERROR FREE, please contact the administrator. Backgrounds will be output at a detailed anomaly information for the administrator to exclude errors.

3.2 Portlet code handle layer
Modify portlet treatment code, the main page and the background is to increase the code interactive features, as described above, login portlet through the acquisition of parameters from JSP Chuan call doLogin (username, pwd, booleanvalue, actionrequest, actionresponse) approach to authentication. If certified by the Jump to successfully configure the portal page, while if it fails returns an error message displayed on the page. In this process, the reader can increase the parameter at Front Desk, in the background of the treatment parameters to increase the code. Therefore, changes in this layer can be enriched and interactive pages.
Generally speaking, are re-writing Ways processAction, but modified to avoid doLogin Ways. doLogin, Customize their own methods of treatment, through the rewriting processAction approach to implementation, in the rewrite before this method must be very clear processAction original approach, when necessary to rewrite doLogin method, these changes based on specific needs . To make code changes at the former, we must understand the original portlet code deal with the logic of clinics to save up some mysterious reason to amend the code to produce a problem difficult to remedy. Nothing source look, they can only look at the decompile. , Fortunately, however, the code logic is very simple.
It is worth emphasizing that, it is proposed to set up a parameter to retain the original treatment methods, such as the following code pattern:

If (paramname!=true) { If (paramname! = True) (
super.processAction(actionrequest, actionresponse);
super.processAction (actionrequest, actionresponse);
} else { ) Else (
//your custom codes / / your custom codes
} )
This is what is meant in order to retain the original approach, this parameter is in the portlet's customization parameters set by this parameter to control the use of those who deal with the code.
Modify the application of different login portlet modify jsp code jsp code modification can be directly entered into force, amend the login portlet application must be re-issued to take effect, the general steps are as follows:
1) RAD package portlet.war put into
2) the preparation of custom log portlet.Generally speaking, the custom portlet is portlet type of the original inheritance.
3) in the project in the portlet.xml configuration, modify custom portlet class name.
4) export packet, the re-release.
Major modifications in the configuration of the portlet into custom categories, re-released to make the entry into force of custom portlet.

3.3 PORTAL Certification Service Layer
In this treatment are at Servlet code level, rather than the portlet container level This is the difference between the two levels above the main difference.So here Servlet containers can get information in order to deal with accordingly.
The following are examples of custom certification services.
Log in user customized information services, customized services for the introduction of the portal services, it is necessary to make the following steps:
1) customized services for LoginUserAuth, it inherited com.ibm.wps.engine.commands.LoginUserAuth.
2) put customized service package into jar, on the directory PORTAL_SERVER / shared / app under
3) Revise the configuration, so that the use of custom portal services (put to amend item # logo removed):
a. Custom Service categories:
PORTAL_SERVER / config / properties / ConfigService.properties document, amended as follows:
#command.login = LoginUserAuth -> command.login = LoginUserAuth
# command.login = LoginUserAuth -> command.login = LoginUserAuth
b. customized service packages:
LoaderService.propertie put the contents of the document, as follows:
#command.path = com.ibm.wps.engine.customize,com.ibm.wps.engine.commands ->
# command.path = com.ibm.wps.engine.customize, com.ibm.wps.engine.commands ->
command.path=com.ibm.wps.engine.commands.yds(),com.ibm.wps.engine.commands
command.path = com.ibm.wps.engine.commands.yds (custom package names), com.ibm.wps.engine.commands

That is, add a custom category of package names, so that the portal to find the path of packets.
4) to allow configuration to take effect,
PORTAL_SERVER / config, the Executive order: WPSconfig.bat / sh update-properties
5) restart the portal.
The following is a custom class code:
package com.ibm.wps.engine.commands.yds();
package com.ibm.wps.engine.commands.yds (custom package name);


/** / **

* *
*/ * /
public class LoginUserAuth extends com.ibm.wps.engine.commands.LoginUserAuth { public class LoginUserAuth extends com.ibm.wps.engine.commands.LoginUserAuth (

protected void doPostLogin(RunData aRunData, String aUserID, protected void doPostLogin (RunData aRunData, String aUserID,
String aPassword) throws WpsException { String aPassword) throws WpsException (

//custom your codes / / custom your codes

System.out.println("UserID: "+aUserID+" Login !"); System.out.println ( "UserID:" + aUserID + "Login!");

super.doPostLogin(aRunData, aUserID, aPassword); super.doPostLogin (aRunData, aUserID, aPassword);

//custom your codes / / custom your codes

} )

} )
Print Service log in more than just user name, readers can according to their own needs, customize their own code.
Here we usually will add a user log analysis function, because the success of log doPostLogin method is called after the code, where users can add after the success of log information processing, such as record user names, log time and log IP and so on the user's log in information, but would also like to add at Logout service users quit at the time of treatment code, so as to achieve a complete login logout function.
Logout Services Services Login with methods similar changes.

4. Concluding remarks
This article tells about the way the composition of the default log in (login portlet and certification services), highlight how to modify them to customize the treatment, mainly three levels of strategy: view layer, portlet handle code layer and portal layer authentication service.
Hope that this three-pronged approach to customize the code, implementation of different needs. In this paper, only some simple use case shows that the view changes to layer over easy because, in general, developers will be modified in this area, but behind the two-tier made a more detailed explanation. Hope that the above amendments to the development of ideas can help solve the needs of a variety of sign ideas.