<?xml version="1.0"?>
<!--
-$Id: build-webapps.xml,v 1.8 2003/07/14 11:43:52 maxcooper Exp $
-$Revision: 1.8 $
-$Date: 2003/07/14 11:43:52 $
+$Id: build-webapps.xml,v 1.9 2004/01/26 10:53:49 maxcooper Exp $
+$Revision: 1.9 $
+$Date: 2004/01/26 10:53:49 $
-->
<!DOCTYPE project [
<pathelement location="${web.dir}/catalina-example"/>
</path>
+ <!-- ========== rememberme web app ============================================================================== -->
+
+ <path id="rememberme.src.path" path="${src.example.dir}"/>
+
+ <fileset id="rememberme.lib.files" dir="${build.lib.dir}">
+ <patternset refid="common.lib.files"/>
+ </fileset>
+
+ <path id="rememberme.static.path">
+ <pathelement location="${web.dir}/share"/>
+ <pathelement location="${web.dir}/rememberme"/>
+ </path>
+
<!-- ========== main targets ==================================================================================== -->
<target name="build">
<antcall target="build-webapp" inheritall="false">
<param name="webapp.name" value="catalina"/>
</antcall>
+ <antcall target="build-webapp" inheritall="false">
+ <param name="webapp.name" value="rememberme"/>
+ </antcall>
</target>
<target name="dist">
<antcall target="webapp-war" inheritall="false">
<param name="webapp.name" value="catalina"/>
</antcall>
+ <antcall target="webapp-war" inheritall="false">
+ <param name="webapp.name" value="rememberme"/>
+ </antcall>
</target>
<target name="deploy">
<ant antfile="deploy.xml" inheritall="false" target="deploy">
<property name="webapp.name" value="${project.name}-catalina"/>
</ant>
+ <ant antfile="deploy.xml" inheritall="false" target="deploy">
+ <property name="webapp.name" value="${project.name}-rememberme"/>
+ </ant>
</target>
<target name="undeploy">
<ant antfile="deploy.xml" inheritall="false" target="undeploy">
<property name="webapp.name" value="${project.name}-catalina"/>
</ant>
+ <ant antfile="deploy.xml" inheritall="false" target="undeploy">
+ <property name="webapp.name" value="${project.name}-rememberme"/>
+ </ant>
</target>
<!-- ========== webapp targets ================================================================================== -->
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE securityfilter-config PUBLIC
+ "-//SecurityFilter.org//DTD Security Filter Configuration 2.0//EN"
+ "http://www.securityfilter.org/dtd/securityfilter-config_2_0.dtd">
+
+<securityfilter-config>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Secure Page</web-resource-name>
+ <url-pattern>/securePage.jsp</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>inthisrole</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Secure page that the example user is not authorized to view</web-resource-name>
+ <url-pattern>/forbiddenPage.jsp</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>notinthisrole</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <form-login-config>
+ <form-login-page>/loginForm.jsp</form-login-page>
+ <form-error-page>/loginError.jsp</form-error-page>
+ <form-default-page>/index.jsp</form-default-page>
+ <!-- logout page definition is important for persistent logins -->
+ <form-logout-page>/logout.jsp</form-logout-page>
+ <!-- remember-me config -->
+ <remember-me className="org.securityfilter.authenticator.persistent.DefaultPersistentLoginManager">
+ <!-- optional settings for default persistent login manager -->
+ <remember-me-param name="cookieLife" value="15"/>
+ <remember-me-param name="protection" value="all"/>
+ <remember-me-param name="useIP" value="true"/>
+ <remember-me-param name="encryptionAlgorithm" value="DES"/>
+ <remember-me-param name="encryptionMode" value="ECB"/>
+ <remember-me-param name="encryptionPadding" value="PKCS5Padding"/>
+ <!-- encryption keys; customize for each application -->
+ <!-- NOTE: these kys must be speciied AFTER other encryption settings -->
+ <remember-me-param name="validationKey" value="347382902489402489754895734890347"/>
+ <remember-me-param name="encryptionKey" value="347892347028490237487846240673842"/>
+ </remember-me>
+ </form-login-config>
+ </login-config>
+
+ <realm className="org.securityfilter.example.realm.TrivialSecurityRealm">
+ <realm-param name="exampleProperty" value="it works!" />
+ </realm>
+
+</securityfilter-config>
\ No newline at end of file
--- /dev/null
+<%@ page import="org.securityfilter.example.Constants"%>
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title><%=Constants.LOGIN_TITLE%></title>
+</head>
+<body>
+
+<h1><%=Constants.LOGIN_TITLE%></h1>
+
+<%@include file="/menu.jsp" %>
+
+Login with username=<i><%=Constants.VALID_USERNAME%></i>
+and password=<i><%=Constants.VALID_PASSWORD%></i>.
+
+<form id="<%=Constants.LOGIN_FORM_ID%>" action="<%=response.encodeURL(Constants.LOGIN_FORM_ACTION)%>" method="POST">
+
+Username:
+<input type="text"
+ name="<%=Constants.LOGIN_USERNAME_FIELD%>"
+ value="<%=Constants.VALID_USERNAME%>"
+><p>
+
+Password:
+<input type="password"
+ name="<%=Constants.LOGIN_PASSWORD_FIELD%>"
+ value="<%=Constants.VALID_PASSWORD%>"
+><p>
+
+<input type="checkbox"
+ name="<%=Constants.LOGIN_REMEMBERME_FIELD%>"
+ value="true"
+> Remember Me<p>
+
+<input type="Submit">
+
+</form>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+<p>
+Navigation Menu: [
+<a href="<%=response.encodeURL("index.jsp")%>">Home</a>
+| <a href="<%=response.encodeURL("securePage.jsp")%>">Secure Page</a>
+| <a href="<%=response.encodeURL("forbiddenPage.jsp")%>">Forbidden Secure Page</a>
+| <a href="<%=response.encodeURL("loginForm.jsp")%>">Direct Login</a>
+| <a href="<%=response.encodeURL("logout.jsp")%>">Logout</a>
+]<p>