5.13.3.4  Login Authentication and Authorization

 



Overview

 

The Login page is the first page that is shown when the Web NMS Web Client starts up. Validation of the login attempt and the

session is called 'Authentication'. Checking if the logged in user is allowed to perform a selected action is called 'Authorization'.This topic deals with customizing the Login.jsp page and details on authentication and authorization.

 

Understanding Login Function

 

The Login page (or the start up page) is rendered by the Login.jsp file located in <Web NMS Home>/webclient/common/jsp directory. Preliminary, client-side validation of 'User Name' and 'Password' fields is done by this file. On choosing the 'WebStart' client the Login.jsp file verifies if Java WebStart is installed on the client machine, and accordingly forwards the request to WebStart.do (in turn WebStart.jsp of <Web NMS Home>/jsp directory is invoked). Similarly, on choosing 'Applet' client, the request is forwarded and the index.jsp file (of <Web NMS Home>/jsp directory) is invoked.

 

Logging in fails on providing incorrect username or password in the login page, during authentication. The login action is handled by the LoginAction  class while the PasswordAction, class handles the action related to authentication. Once the user logs out the settings configured by the user in the client interface is saved. All the actions performed during logging out is handled by the  LogoutAction class.  

 

Password Expiration

 

When the user password expires an appropriate message is displayed or the passwordExpiry.jsp is invoked. This passwordExpiry.jsp file displays the form through which the password and its expiration time can be configured. The configuration of the user password and its expiration time is handled by the UserConfigAPI.changePassword() and UserConfigAPI.setUserStatus() methods of the UserConfigAPI class.  

 

 

Note: All the JSP files related to login are found in <Web NMS Home>/webclient/common/jsp directory.

 

Customizing Login

 

The startup page or the login page of Web NMS clients is designed and laid by the Login.jsp file located in <Web NMS Home>/webclient/common/jsp directory.

Some of the customizations that can be performed in the login page are,

 <input type="radio" name="clienttype" value="applet">

 

Backward Compatibility of Login.jsp file

 

If you have customized the Login.jsp file available under <Web NMS Home>/jsp directory in versions prior to Web NMS 4.5.0 and want to retain the customizations for the login page in the Web Client (of Web NMS 4.5.0) too, then do the following,

DirectoryIndex jsp/Login.jsp

<!--filter>

<filter-name>AuthenticationFilter</filter-name>

<filter-class>com.adventnet.nms.webclient.login.AuthenticationFilter</filter-class>

<init-param>

<param-name>excludeAuthentication</param-name>

<param-value>Login.jsp,LoginPage.do,WebStart,jnlp</param-value>

</init-param>

</filter-->

<!--filter-mapping>

<filter-name>AuthenticationFilter</filter-name>

<url-pattern>*.do</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>AuthenticationFilter</filter-name>

<url-pattern>*.jsp</url-pattern>

</filter-mapping-->

Authentication

 

Authentication of user input is handled by the AuthenticationFilter class. The following entry in web.xml ensures that all pages sent as requests or received as responses, pass through the AuthenticationFilter. Hence, every operation performed by the current user is authenticated.

 

<filter>

<filter-name>AuthenticationFilter</filter-name>

<filter-class>com.adventnet.nms.webclient.login.AuthenticationFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>AuthenticationFilter</filter-name>

<url-pattern>*.do</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>AuthenticationFilter</filter-name>

<url-pattern>*.jsp</url-pattern>

</filter-mapping>

 

AuthenticationFilter can be extended to handle servlet authentication also.

 

Authorization

 

Authorization checks if the current user is allowed to perform a particular action. The method GenericUtility.isAuthorized(userName, operation) is used to check the access permissions for the specified user, for the specified operation.

 

Session Timeout

 

A session timeout defines the maximum time that an existing inactive session is kept alive, before it is terminated by the Web NMS Server. By default, the Web client holds a session for 35 minutes unless explicit Logout has occurred. This value is specified in web.xml as shown below.

    <session-config>

    <session-timeout>35</session-timeout>

    </session-config>

Edit this value if you need to change the session timeout period.



Copyright © 2009 ZOHO Corp. All Rights Reserved.