
96
Novell Access Manager 3.1 SP2 J2EE Agent Guide
n
ov
do
cx (e
n)
16
Ap
ril 20
10
For more information on testing the configuration, see
Section 7.4.4, “Testing the Configuration,”
on page 106
.
7.2 Preparing the Sample Application for the
Agent
Each Web application that you want to use with the J2EE Agent must be able to log in and log out of
the Identity Server that you have configured the J2EE Agent to trust. You do this by configuring the
web.xml
file of the application.
The following sections describe the procedure to configure the
web.xml
file of the sample
application (
PayrollApp.ear
):
Section 7.2.1, “Configuring for Login,” on page 96
Section 7.2.2, “Configuring for Logout,” on page 96
7.2.1 Configuring for Login
In order to configure the login, you must specify in the
web.xml
file that the Web application uses
FORM authentication. This is specified in the
<login-config>
section of the application
descriptor in the
WEB-INF/web.xml
file as follows:
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login</form-login-page>
<form-error-page>/login</form-error-page>
</form-login-config>
</login-config>
The
<form-login-page>
and
<form-error-page>
elements need to be set to a URL that is
mapped to the following servlet class:
com.novell.nids.agent.auth.LoginServlet
The
<login-config>
element in the example above specifies
/login
as the login page and the
error page. The
/login
URL needs a servlet mapping within the application's
web.xml
file:
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>
com.novell.nids.agent.auth.LoginServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
7.2.2 Configuring for Logout
To add a logout servlet and its servlet mapping to the
web.xml
file, modify the contents of
web.xml
as follows:
Содержание Access Manager 3.1 SP 2
Страница 4: ...4 Novell Access Manager 3 1 SP2 J2EE Agent Guide novdocx en 16 April 2010...
Страница 8: ...8 Novell Access Manager 3 1 SP2 J2EE Agent Guide novdocx en 16 April 2010...
Страница 44: ...44 Novell Access Manager 3 1 SP2 J2EE Agent Guide novdocx en 16 April 2010...
Страница 83: ...Preparing the Applications and the J2EE Servers 83 novdocx en 16 April 2010...
Страница 108: ...108 Novell Access Manager 3 1 SP2 J2EE Agent Guide novdocx en 16 April 2010...