Hitachi

uCosminexus Application Server Security Management Guide


The WebPasswordHandler constructor

Organization of this page

Description

Creates an instance of the WebPasswordHandler class.

This constructor allows you to use either memory or a file to specify user information (attributes) to be stored in the Credential (UserAttributes). The request and response parameters are mandatory. If null is specified, a ParameterError exception occurs.

Syntax

public WebPasswordHandler(HttpServletRequest request,
                               HttpServletResponse response,
                               AttributeEntry[] aliases,
                               String url,
                               boolean urlforward)
  throws FormatError, ParameterError;
 
public WebPasswordHandler(HttpServletRequest request,
                               HttpServletResponse response,
                               String aliasesFile,
                               String url,
                               boolean urlforward)
  throws IOException, SecurityException, FormatError,
  ParameterError;

Parameters

request:

Specifies the JSP/Servlet activation parameter with no changes.

response:

Specifies the JSP/Servlet activation parameter with no changes.

aliases:

Specifies the information to be included in the Credential (UserAttributes) that is created when authentication succeeds. If there is no information to be obtained, specify null. In this case, no Credential is created (an empty UserAttributes object is created). For aliases, specify an array of AttributeEntry objects. If the specified parameter lacks necessary information, a FormatError exception occurs (because a mandatory value is not stored or because a value that violates the format is specified).

aliasesFile:

Specifies the information to be included in the Credential (UserAttributes) that is created when authentication succeeds. If there is no information to be obtained, specify null. In this case, no Credential is created (an empty UserAttributes object is created). For aliasesFile, specify a file name. If the specified parameter lacks necessary information, a FormatError exception occurs (because a mandatory value is not stored or because a value that violates the format is specified).

url:

Specifies the URL from which the authentication information (user ID or password) is to be obtained from the user. If the URL is specified, a Login Form is passed to the RequestDispatcher object according to the specified urlforward parameter (when input information is obtained from the user). If there is no need to specify the URL, specify null. In this case, the urlforward value is not referenced. If you specify null and authentication information cannot be obtained after execution of the handle method (because this information is not stored in HttpServletRequest), LoginException occurs after the LoginContext class's login method is executed.

urlforward:

Specifies how to display the URL. If this parameter is set to true for the specified URL, the forward method of the RequestDispatcher object is called. If it is set to false, the include method of that object is called.

Exceptions

java.io.FileNotFoundException:

The specified file cannot be opened because it is missing or is a directory, or because of some other reason (when the exception occurs in the constructor of the FileInputStream class).

java.lang.SecurityException:

SecurityManager is present, and read access to the file using SecurityManager's checkRead method has been rejected.

java.io.IOException:

An attempt to read the file has failed.

com.cosminexus.admin.common.ParameterError:

A reference to HttpServletRequest or HttpServletResponse is not specified.

com.cosminexus.admin.common.FormatError:

Either or both of the aliases or aliasesFile parameters lack necessary information or contain extra information.