You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2008/09/09 01:31:35 UTC

svn commit: r693316 [1/3] - in /portals/jetspeed-2/applications/mfa: ./ WebContent/ WebContent/META-INF/ WebContent/WEB-INF/ WebContent/WEB-INF/lib/ WebContent/WEB-INF/view/ WebContent/captchas/ WebContent/images/ src/ src/org/ src/org/apache/ src/org/...

Author: taylor
Date: Mon Sep  8 16:31:33 2008
New Revision: 693316

URL: http://svn.apache.org/viewvc?rev=693316&view=rev
Log:
contributing a multifaceted login portlet application with captcha and personal question features. Only works with Jetspeed due to no-standardization on authentication calls

Added:
    portals/jetspeed-2/applications/mfa/WebContent/
    portals/jetspeed-2/applications/mfa/WebContent/META-INF/
    portals/jetspeed-2/applications/mfa/WebContent/META-INF/MANIFEST.MF
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/jetspeed-portlet.xml
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/lib/
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/mfa.properties
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.tld
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.xml
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/tts.properties
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll-login.jsp
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll.jsp
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/loggedon.jsp
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login1.jsp
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login2.jsp
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login3.jsp
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login4.jsp
    portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/web.xml
    portals/jetspeed-2/applications/mfa/WebContent/captchas/
    portals/jetspeed-2/applications/mfa/WebContent/captchas/placeholder
    portals/jetspeed-2/applications/mfa/WebContent/images/
    portals/jetspeed-2/applications/mfa/WebContent/images/jetspeedlogo98.jpg   (with props)
    portals/jetspeed-2/applications/mfa/build.properties
    portals/jetspeed-2/applications/mfa/build.xml
    portals/jetspeed-2/applications/mfa/pom.xml
    portals/jetspeed-2/applications/mfa/src/
    portals/jetspeed-2/applications/mfa/src/org/
    portals/jetspeed-2/applications/mfa/src/org/apache/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/CaptchaBean.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MFA.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MultiFacetedAuthentication.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/SecurityQuestionBean.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/TextToSpeechBean.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaBeanImpl.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaConfiguration.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaImageResource.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/MFAServletListener.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/MultiFacetedAuthenticationImpl.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/RemovableResource.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/ResourceRemovalCache.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/TTSConfiguration.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/TextToSpeechBeanImpl.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/portlets/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/portlets/MFALogin.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/portlets/StatusMessage.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/portlets/UserBean.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/portlets/resources/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/portlets/resources/MFAResources.properties
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/util/
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/util/QuestionFactory.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/util/SecurityHelper.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/util/ServerData.java
    portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/util/URIConstants.java
    portals/jetspeed-2/applications/mfa/xdocs/
    portals/jetspeed-2/applications/mfa/xdocs/index.xml

Added: portals/jetspeed-2/applications/mfa/WebContent/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/META-INF/MANIFEST.MF?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/META-INF/MANIFEST.MF (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/META-INF/MANIFEST.MF Mon Sep  8 16:31:33 2008
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/jetspeed-portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/jetspeed-portlet.xml?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/jetspeed-portlet.xml (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/jetspeed-portlet.xml Mon Sep  8 16:31:33 2008
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<portlet-app id="mfa" version="1.0"
+    xmlns="http://portals.apache.org/jetspeed"
+    xmlns:js="http://portals.apache.org/jetspeed"
+    xmlns:dc="http://www.purl.org/dc"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://portals.apache.org/jetspeed http://portals.apache.org/jetspeed-2/2.1/schemas/jetspeed-portlet.xsd">
+
+   <js:security-constraint-ref>admin</js:security-constraint-ref>
+ 
+    <dc:title>MFA Administration Portlets</dc:title>
+ 
+    <portlet>
+        <portlet-name>MFALogin</portlet-name>
+        <js:security-constraint-ref>public-view</js:security-constraint-ref>       
+        <dc:title>Login</dc:title>
+        <dc:creator>J2 Team</dc:creator>
+    </portlet>
+			
+	<js:services>        
+        <js:service name='UserManager'/>     
+        <js:service name='AuditActivity'/>
+	</js:services>
+
+</portlet-app>

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/mfa.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/mfa.properties?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/mfa.properties (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/mfa.properties Mon Sep  8 16:31:33 2008
@@ -0,0 +1,43 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# captcha properties
+captcha.directory = /captchas
+captcha.effects.noise = false
+captcha.image.background = images/jetspeedlogo98.jpg
+captcha.image.background.use = true
+catcha.image.format = .jpg
+captcha.font.antialiasing = true
+captcha.font.size = 36
+captcha.font.size.random = false
+captcha.font.style = 0
+captcha.font.names = Times
+captcha.scanrate.seconds = 300
+captcha.timetolive.seconds = 120
+captcha.text.maxlength = 8
+captcha.text.margin.left = 2
+captcha.text.margin.bottom = 10
+captcha.text.minlength = 6
+captcha.text.rise.range = 30
+# vertical alignment variance (35)
+captcha.text.rotation = 10
+# shearing 0.2 - 0.9
+captcha.text.shear = 0
+captcha.text.spacing = 2
+captcha.timestamp = true
+captcha.timestamp.24hr = true
+captcha.timestamp.tz = America/New_York
+captcha.timestamp.font.size = 8
+
+        
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.tld
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.tld?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.tld (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.tld Mon Sep  8 16:31:33 2008
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!DOCTYPE taglib PUBLIC
+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
+<taglib>
+    <tlibversion>1.0</tlibversion>
+    <jspversion>1.1</jspversion>
+    <shortname>Tags for portlets</shortname>
+    <tag>
+        <name>defineObjects</name>
+        <tagclass>org.apache.pluto.tags.DefineObjectsTag</tagclass>
+        <teiclass>org.apache.pluto.tags.DefineObjectsTag$TEI</teiclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+    <tag>
+        <name>param</name>
+        <tagclass>org.apache.pluto.tags.ParamTag</tagclass>
+        <bodycontent>empty</bodycontent>
+        <attribute>
+            <name>name</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>value</name>
+            <required>true</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    <tag>
+        <name>actionURL</name>
+        <tagclass>org.apache.pluto.tags.ActionURLTag</tagclass>
+        <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
+        <bodycontent>JSP</bodycontent>
+        <attribute>
+            <name>windowState</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>portletMode</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>secure</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>var</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    <tag>
+        <name>renderURL</name>
+        <tagclass>org.apache.pluto.tags.RenderURLTag</tagclass>
+        <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
+        <bodycontent>JSP</bodycontent>
+        <attribute>
+            <name>windowState</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>portletMode</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>secure</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>var</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+    </tag>
+    <tag>
+        <name>namespace</name>
+        <tagclass>org.apache.pluto.tags.NamespaceTag</tagclass>
+        <bodycontent>empty</bodycontent>
+    </tag>
+</taglib>

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.xml?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.xml (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/portlet.xml Mon Sep  8 16:31:33 2008
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<portlet-app id="mfa"
+    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
+
+  <portlet id="MFALogin">
+    <description>MFA Login</description>
+    <portlet-name>MFALogin</portlet-name>
+    <display-name>MFA Login</display-name>
+    <portlet-class>org.apache.jetspeed.security.mfa.portlets.MFALogin</portlet-class>
+    <init-param>
+      <name>ViewPage</name>
+      <value>/WEB-INF/view/login1.jsp</value>
+    </init-param>
+    
+    <init-param>
+    	<name>cookieLifetime</name>
+    	<value>345600</value>
+    </init-param>
+
+    <init-param>
+    	<name>maxNumberOfAuthenticationFailures</name>
+    	<value>5</value>
+    </init-param>
+    
+    <init-param>
+    	<name>randomQuestions</name>
+    	<value>What was the first and last name of your favorite teacher?
+    	       What was your favorite sport, team, or athlete when you were 16?
+    	       What was your favorite place to visit when you were 16?
+    	       Who was your favorite actor, musician, or artist when you were in high-school?
+    	       What is the first name of your first boyfriend?
+    	       What is the first name of your first girlfriend?
+    	       What is the name of your first elementary school?
+    	       What was the high school mascot at the last high school you attended?
+    	       In what city was your first elementary school?
+    	       In what city was your mother born?
+    	       In what city was your father born?
+    	       What is the first name of your maternal grandmother (your mother's mother)?
+    	       What is the first name of your paternal grandmother (your father's mother)?
+    	       What is the first name of your maternal grandfather (your mother's father)?
+    	       What is the first name of your paternal grandfather (your father's father)?
+    	       Who was your first employer?
+    	       In what city did you meet your spouse?
+    	       What was the first name of your first roommate during college?
+    	       In what city did you get married?
+    	       How old were you at your wedding?
+    	       What was the first name of the best man at your wedding?
+    	       What was the first name of the maid of honor at your wedding?</value>
+    </init-param>
+    
+    <init-param>
+    	<name>failOnMisconfiguredUser</name>
+    	<value>false</value>
+    </init-param>
+ 
+    <supports>
+      <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+    </supports>
+        <supported-locale>en</supported-locale>
+    <portlet-info>
+      <title>Login</title>
+      <short-title>Login</short-title>
+      <keywords>MFA, login</keywords>
+    </portlet-info>
+     <portlet-preferences>
+     </portlet-preferences>
+  </portlet>
+
+</portlet-app>

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/tts.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/tts.properties?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/tts.properties (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/tts.properties Mon Sep  8 16:31:33 2008
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# text-to-speech properties
+tts.directory = /captchas
+tts.image.format = .wav
+tts.voice.name = kevin16
+
+
+A = Alpha
+B = Bravo
+C = Charlie
+D = Delta
+E = Echo
+F = Foxtrot
+G = Golf
+H = Hotel
+I = India
+J = Juliet
+K = Kilo
+L = Lima
+M = Mike
+N = November
+O = Oscar
+P = Papa
+Q = Quebec
+R = Romeo
+S = Sierra
+T = Tango
+U = Uniform
+V = Victor
+W = Whiskey
+X = X-ray
+Y = Yankee
+Z = Zulu
+YOUR_SECURE_IMAGE_TEXT_IS = "Your secure image text is ,, "
+capital = ", "capital "
+number = ", "number "
+AS_IN = ", ",, as in "
+debug = true
+pitch = 150
+rate = 110
+

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll-login.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll-login.jsp?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll-login.jsp (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll-login.jsp Mon Sep  8 16:31:33 2008
@@ -0,0 +1,109 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@page import="org.apache.jetspeed.login.LoginConstants"%>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
+<%@taglib uri="http://java.sun.com/jstl/core" prefix="cr"%>
+<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
+<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
+
+<%@ page import="org.apache.jetspeed.security.mfa.MFA" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.MFALogin" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.StatusMessage" %>
+<%@ page import="org.apache.jetspeed.security.mfa.CaptchaBean" %>
+<%@ page import="org.apache.jetspeed.security.mfa.impl.CaptchaBeanImpl" %>
+
+<portlet:defineObjects/>
+<jsp:useBean id="userBean" scope="session" class="org.apache.jetspeed.security.mfa.portlets.UserBean" />
+<portlet:actionURL var="restartAction" >
+	<portlet:param name="phase" value="restart"/>
+</portlet:actionURL>
+<portlet:actionURL var="submitAction" />
+
+<fmt:setBundle basename="org.apache.jetspeed.security.mfa.portlets.resources.MFAResources" />
+
+<c:set var="requestContext" value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
+<c:set var="loginDestination" value="<%=LoginConstants.DESTINATION%>"/>
+<c:set var="portalContextPath" value="${requestContext.request.contextPath}"/>
+<c:if test="${empty portalContextPath}">
+  <c:set var="portalContextPath" value="/"/>
+</c:if>
+<c:set var="encoder" value="${requestContext.request.parameterMap.encoder[0]}"/>
+<c:set var="destLogin" value="/login/proxy"/>
+<c:set var="destLogout" value="/login/logout"/>
+<c:set var="destAccount" value="/portal/my-account.psml"/>
+<c:if test="${not empty encoder && encoder == 'desktop'}">
+  <c:set var="destLogin" value="${destLogin}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destLogout" value="${destLogout}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destAccount" value="/desktop/my-account.psml?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+</c:if>
+
+<%
+StatusMessage statusMsg = (StatusMessage)renderRequest.getAttribute(MFALogin.STATUS_MESSAGE);
+if (statusMsg != null)
+{   
+%>
+<br/>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+	<div class="<%= statusMsg.getType() %>"><%= statusMsg.getText() %></div>
+</tr>
+</table>
+<%
+}
+%>
+
+<%-- backdoor access to the portal session to get the login error count --%>
+<c:set var="errorCode" value="<%=((RequestContext)request.getAttribute(RequestContext.REQUEST_PORTALENV)).getSessionAttribute(MFALogin.ERRORCODE)%>"/>
+<c:choose>    
+  <c:when test="${not empty errorCode}">
+    <br>
+    <div class="portlet-msg-alert">
+      <fmt:message key="login.label.ErrorCode.${errorCode}"/>
+    </div>
+    <br>
+  </c:when>
+  <c:otherwise>
+    <c:set var="retryCount" value="<%=((RequestContext)request.getAttribute(RequestContext.REQUEST_PORTALENV)).getSessionAttribute(MFALogin.RETRYCOUNT)%>"/>
+    <c:if test="${not empty retryCount}">
+      <br>
+      <div class="portlet-msg-alert">
+        <fmt:message key="login.label.InvalidUsernameOrPassword"><fmt:param value="${retryCount}"/></fmt:message>
+      </div>
+      <br>
+    </c:if>
+  </c:otherwise>
+</c:choose>
+
+<form method="POST" action='${submitAction}'>
+  <table border="0">
+  <tr>
+    <td><div class="portlet-form-field-label"><fmt:message key="login.label.Password"/></div></td>
+    <td><input type="password" class="portlet-form-field" size="30" name="<%=LoginConstants.PASSWORD%>"></td>
+  </tr>
+  <tr>
+    <td colspan="2"><input type="submit" class="portlet-form-button" value="<fmt:message key="login.label.Login"/>"></td>
+  </tr>
+  </table>
+  <input type='hidden' value='<c:url context="${portalContextPath}" value="/"/>' name='redirect' id='redirect'/>
+  <input type='hidden' name='phase' id='phase' value='enroll-login'/>  
+</form>
+<br/>
+
+<a href='${restartAction}'>Restart login sequence</a>
+
+

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll.jsp?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll.jsp (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/enroll.jsp Mon Sep  8 16:31:33 2008
@@ -0,0 +1,110 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@page import="org.apache.jetspeed.login.LoginConstants"%>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.MFALogin" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.StatusMessage" %>
+
+<%@ page import="java.util.List" %>
+<%@ page import="org.apache.jetspeed.security.mfa.util.QuestionFactory" %>
+<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
+<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
+
+<portlet:defineObjects/>
+<portlet:actionURL var="submitAction" />
+<portlet:actionURL var="restartAction" >
+	<portlet:param name="phase" value="restart"/>
+</portlet:actionURL>
+
+<jsp:useBean id="userBean" scope="session" class="org.apache.jetspeed.security.mfa.portlets.UserBean" />
+<jsp:useBean id="securityQuestion" scope="session" class="org.apache.jetspeed.security.mfa.SecurityQuestionBean" />
+
+<c:set var="requestContext" value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
+<c:set var="loginDestination" value="<%=LoginConstants.DESTINATION%>"/>
+<c:set var="portalContextPath" value="${requestContext.request.contextPath}"/>
+<c:if test="${empty portalContextPath}">
+  <c:set var="portalContextPath" value="/"/>
+</c:if>
+<c:set var="encoder" value="${requestContext.request.parameterMap.encoder[0]}"/>
+<c:set var="destLogin" value="/login/proxy"/>
+<c:set var="destLogout" value="/login/logout"/>
+<c:set var="destAccount" value="/portal/my-account.psml"/>
+<c:if test="${not empty encoder && encoder == 'desktop'}">
+  <c:set var="destLogin" value="${destLogin}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destLogout" value="${destLogout}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destAccount" value="/desktop/my-account.psml?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+</c:if>
+
+<%
+StatusMessage statusMsg = (StatusMessage)renderRequest.getAttribute(MFALogin.STATUS_MESSAGE);
+if (statusMsg != null)
+{   
+%>
+<br/>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+	<div class="<%= statusMsg.getType() %>"><%= statusMsg.getText() %></div>
+</tr>
+</table>
+<%
+}
+%>
+
+<form name="enroll" method="post" action="${submitAction}">
+
+<%= userBean.getQuestion() %><br/>
+<select name="question1">
+<%
+   QuestionFactory questions = (QuestionFactory)renderRequest.getAttribute(MFALogin.QUESTION_FACTORY);
+   List list1 = questions.getAllQuestionsInRandomOrder();
+   for (int i=0; i<list1.size(); i++)
+   {
+%>
+<option value="<%= list1.get(i) %>"><%= list1.get(i) %></option>
+<% } %>
+</select>
+<input type="text" id="answer1" name="answer1"/><br/>
+<select name="question2">
+<% List list2 = questions.getAllQuestionsInRandomOrder();
+   for (int i=0; i<list2.size(); i++)
+   {
+%>
+ <option value="<%= list2.get(i) %>"><%= list2.get(i) %></option>
+<% } %>
+</select>
+<input type="text" id="answer2" name="answer2"/><br/>
+<select name="question3">
+<% List list3 = questions.getAllQuestionsInRandomOrder();
+   for (int i=0; i<list3.size(); i++)
+   {
+%>
+ <option value="<%= list3.get(i) %>"><%= list3.get(i) %></option>
+ <% } %>
+</select>
+<input type="text" id="answer3" name="answer3"/><br/>
+<br/>
+<p>Please enter a pass phrase to be displayed when you login. Everytime you login, make sure you see this unique passphrase.
+This is not a password, but simply a method for you to be sure you are logging into the correct system.</p>
+<p>Passphrase: <input type="text" id="passphrase" name="passphrase"/></p>
+<input type='hidden' id='phase' name='phase' value='enroll'/>
+<input type='hidden' value='<c:url context="${portalContextPath}" value="/"/>' name='redirect' id='redirect'/>
+<input type="submit" />
+</form>
+<br/>
+
+<a href='${restartAction}'>Restart login sequence</a>
+

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/loggedon.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/loggedon.jsp?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/loggedon.jsp (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/loggedon.jsp Mon Sep  8 16:31:33 2008
@@ -0,0 +1,41 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@page import="org.apache.jetspeed.login.LoginConstants"%>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
+
+<c:set var="requestContext" value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
+<c:set var="loginDestination" value="<%=LoginConstants.DESTINATION%>"/>
+<c:set var="portalContextPath" value="${requestContext.request.contextPath}"/>
+<c:if test="${empty portalContextPath}">
+  <c:set var="portalContextPath" value="/"/>
+</c:if>
+<c:set var="encoder" value="${requestContext.request.parameterMap.encoder[0]}"/>
+<c:set var="destLogin" value="/login/proxy"/>
+<c:set var="destLogout" value="/login/logout"/>
+<c:set var="destAccount" value="/portal/my-account.psml"/>
+<c:if test="${not empty encoder && encoder == 'desktop'}">
+  <c:set var="destLogin" value="${destLogin}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destLogout" value="${destLogout}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destAccount" value="/desktop/my-account.psml?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+</c:if>
+<div class="portlet-section-text">
+    Welcome <c:out value="${pageContext.request.userPrincipal.name}"/><br>
+    <a href='<c:url context="${portalContextPath}" value="${destLogout}"/>'>Logout</a>
+    <br>
+    <a href='<c:url context="${portalContextPath}" value="${destAccount}"/>'>Change Password</a>
+</div>

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login1.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login1.jsp?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login1.jsp (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login1.jsp Mon Sep  8 16:31:33 2008
@@ -0,0 +1,69 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.MFALogin" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.StatusMessage" %>
+
+<%@ page import="org.apache.jetspeed.security.mfa.CaptchaBean" %>
+<%@ page import="org.apache.jetspeed.security.mfa.MultiFacetedAuthentication" %>
+<%@ page import="org.apache.jetspeed.security.mfa.MFA" %>
+
+<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
+
+<portlet:defineObjects/>
+<portlet:actionURL var="submitAction" />
+<jsp:useBean id="userBean" scope="session" class="org.apache.jetspeed.security.mfa.portlets.UserBean" />
+
+<%
+userBean.reset();
+CaptchaBean captcha = MFA.getInstance().createCaptcha(request);
+StatusMessage statusMsg = (StatusMessage)renderRequest.getAttribute(MFALogin.STATUS_MESSAGE);
+if (statusMsg != null)
+{   
+%>
+<br/>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+	<div class="<%= statusMsg.getType() %>">
+	Your request has resulted in an error.
+    </div>
+    <p>
+    <ul>
+    <li>Did you enter an incorrect User ID, Password or mistype the Random Code?</li>
+    <li>If you have completed the security update and you have entered correct information but are not able to log in please contact us. Your account may have been locked out for security reasons.</li>
+    </ul>
+    </p>	
+</tr>
+</table>
+<%
+}
+%>
+
+<jsp:setProperty name="userBean" property="captcha" value="<%= captcha.getChallengeId() %>" />
+<jsp:setProperty name="userBean" property="invalidUser" value="<%= false %>" />
+
+<form name="login1_captcha" method="post" action="${submitAction}">
+<p>Username: <input type="text" id="username" name="username"/></p>
+<p>Type in the text shown in this image:<br/>
+<img src="<%= captcha.getImageURL() %>" /> <input type="text" id="captcha" name="captcha"/></p>
+<input type='hidden' name='phase' id='phase' value='one'/>
+<input type="submit" />
+</form>
+<%-- 
+<p>If you cannot read the text in the image, you may reload to get a new image<% if ( tts.getAudioURL().length() > 0 ) { %>
+	, or <a href="<%= tts.getAudioURL() %>">hear it read aloud</a>
+<% } %>.</p>
+--%>
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login2.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login2.jsp?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login2.jsp (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login2.jsp Mon Sep  8 16:31:33 2008
@@ -0,0 +1,44 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.MFALogin" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.StatusMessage" %>
+
+<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
+
+<portlet:defineObjects/>
+<portlet:actionURL var="submitAction" />
+<portlet:actionURL var="restartAction" >
+	<portlet:param name="phase" value="restart"/>
+</portlet:actionURL>
+
+<jsp:useBean id="userBean" scope="session" class="org.apache.jetspeed.security.mfa.portlets.UserBean" />
+
+<p>Your computer is not recognized.</p>
+
+<form name="login2" method="post" action="${submitAction}">
+
+<%= userBean.getQuestion() %><br/>
+<input type="text" id="answer" name="answer"/><br/>
+<input type="checkbox" id="publicTerminal" name="publicTerminal"/>
+Don't save any credentials on this computer (choose this option e.g. if you're using a public terminal)<br/>
+<input type='hidden' id='phase' name='phase' value='two'/>
+<input type="submit" />
+</form>
+<br/>
+
+<a href='${restartAction}'>Restart login sequence</a>
+

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login3.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login3.jsp?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login3.jsp (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login3.jsp Mon Sep  8 16:31:33 2008
@@ -0,0 +1,115 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@page import="org.apache.jetspeed.login.LoginConstants"%>
+<%@page import="org.apache.jetspeed.request.RequestContext"%>
+<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
+<%@taglib uri="http://java.sun.com/jstl/core" prefix="cr"%>
+<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
+<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
+
+<%@ page import="org.apache.jetspeed.security.mfa.MFA" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.MFALogin" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.StatusMessage" %>
+<%@ page import="org.apache.jetspeed.security.mfa.CaptchaBean" %>
+<%@ page import="org.apache.jetspeed.security.mfa.impl.CaptchaBeanImpl" %>
+
+<portlet:defineObjects/>
+<jsp:useBean id="userBean" scope="session" class="org.apache.jetspeed.security.mfa.portlets.UserBean" />
+<portlet:actionURL var="restartAction" >
+	<portlet:param name="phase" value="restart"/>
+</portlet:actionURL>
+<portlet:actionURL var="submitAction" />
+
+<fmt:setBundle basename="org.apache.jetspeed.security.mfa.portlets.resources.MFAResources" />
+
+<c:set var="requestContext" value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
+<c:set var="loginDestination" value="<%=LoginConstants.DESTINATION%>"/>
+<c:set var="portalContextPath" value="${requestContext.request.contextPath}"/>
+<c:if test="${empty portalContextPath}">
+  <c:set var="portalContextPath" value="/"/>
+</c:if>
+<c:set var="encoder" value="${requestContext.request.parameterMap.encoder[0]}"/>
+<c:set var="destLogin" value="/login/proxy"/>
+<c:set var="destLogout" value="/login/logout"/>
+<c:set var="destAccount" value="/portal/my-account.psml"/>
+<c:if test="${not empty encoder && encoder == 'desktop'}">
+  <c:set var="destLogin" value="${destLogin}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destLogout" value="${destLogout}?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+  <c:set var="destAccount" value="/desktop/my-account.psml?${loginDestination}=${requestContext.request.contextPath}/desktop"/>
+</c:if>
+
+<%
+StatusMessage statusMsg = (StatusMessage)renderRequest.getAttribute(MFALogin.STATUS_MESSAGE);
+if (statusMsg != null)
+{   
+%>
+<br/>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+	<div class="<%= statusMsg.getType() %>"><%= statusMsg.getText() %></div>
+</tr>
+</table>
+<%
+}
+%>
+
+<%-- backdoor access to the portal session to get the login error count --%>
+<c:set var="errorCode" value="<%=((RequestContext)request.getAttribute(RequestContext.REQUEST_PORTALENV)).getSessionAttribute(MFALogin.ERRORCODE)%>"/>
+<c:choose>    
+  <c:when test="${not empty errorCode}">
+    <br>
+    <div class="portlet-msg-alert">
+      <fmt:message key="login.label.ErrorCode.${errorCode}"/>
+    </div>
+    <br>
+  </c:when>
+  <c:otherwise>
+    <c:set var="retryCount" value="<%=((RequestContext)request.getAttribute(RequestContext.REQUEST_PORTALENV)).getSessionAttribute(MFALogin.RETRYCOUNT)%>"/>
+    <c:if test="${not empty retryCount}">
+      <br>
+      <div class="portlet-msg-alert">
+        <fmt:message key="login.label.InvalidUsernameOrPassword"><fmt:param value="${retryCount}"/></fmt:message>
+      </div>
+      <br>
+    </c:if>
+  </c:otherwise>
+</c:choose>
+<% if ( !userBean.getPassPhrase().equals("") ) {
+	CaptchaBean captcha2 = MFA.getInstance().createCaptcha( request, userBean.getPassPhrase() ); %>
+<img src="<%= captcha2.getImageURL() %>" />
+<p>Our secret passphrase is <strong><%= userBean.getPassPhrase() %></strong>.
+If it isn't, stop now and report to your local branch that the server has been breached.</p>
+<% } %>
+
+<form method="POST" action='${submitAction}'>
+  <table border="0">
+  <tr>
+    <td><div class="portlet-form-field-label"><fmt:message key="login.label.Password"/></div></td>
+    <td><input type="password" class="portlet-form-field" size="30" name="<%=LoginConstants.PASSWORD%>"></td>
+  </tr>
+  <tr>
+    <td colspan="2"><input type="submit" class="portlet-form-button" value="<fmt:message key="login.label.Login"/>"></td>
+  </tr>
+  </table>
+  <input type='hidden' value='<c:url context="${portalContextPath}" value="/"/>' name='redirect' id='redirect'/>
+  <input type='hidden' name='phase' id='phase' value='three'/>  
+</form>
+<br/>
+
+<a href='${restartAction}'>Restart login sequence</a>
+
+

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login4.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login4.jsp?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login4.jsp (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/view/login4.jsp Mon Sep  8 16:31:33 2008
@@ -0,0 +1,36 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.MFALogin" %>
+<%@ page import="org.apache.jetspeed.security.mfa.portlets.StatusMessage" %>
+<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
+
+<portlet:actionURL var="restartAction" >
+	<portlet:param name="phase" value="restart"/>
+</portlet:actionURL>
+
+<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
+
+<portlet:defineObjects/>
+<portlet:actionURL var="submitAction" />
+<br/>
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+<tr>
+	<div class="portlet-msg-alert">Your account has been locked. Please contact your administrator.</div>
+</tr>
+</table>
+
+<a href='${restartAction}'>Return to login</a>

Added: portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/web.xml?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/web.xml (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/WEB-INF/web.xml Mon Sep  8 16:31:33 2008
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+  <description>debug web.xml</description>
+
+  <listener>
+    <listener-class>org.apache.jetspeed.security.mfa.impl.MFAServletListener</listener-class>
+  </listener>
+
+  <listener>
+    <listener-class>org.apache.jetspeed.webapp.logging.Log4JConfigurator</listener-class>
+  </listener>
+     
+  <!-- Servlet Definitions -->
+  <servlet>
+    <description>MVC Servlet for Jetspeed Portlet Applications</description>
+    <display-name>Jetspeed Container</display-name>
+    <servlet-name>JetspeedContainer</servlet-name>
+    <servlet-class>org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class>
+    <init-param>
+      <param-name>contextName</param-name>
+      <param-value>mfa</param-value>
+    </init-param>                            
+    <load-on-startup>100</load-on-startup>      
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>JetspeedContainer</servlet-name>
+    <url-pattern>/container/*</url-pattern>
+  </servlet-mapping>
+
+</web-app>

Added: portals/jetspeed-2/applications/mfa/WebContent/captchas/placeholder
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/captchas/placeholder?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/WebContent/captchas/placeholder (added)
+++ portals/jetspeed-2/applications/mfa/WebContent/captchas/placeholder Mon Sep  8 16:31:33 2008
@@ -0,0 +1,2 @@
+This file exists solely to ensure that the "captchas" folder is properly 
+created when the project is built and deployed.
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/WebContent/images/jetspeedlogo98.jpg
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/WebContent/images/jetspeedlogo98.jpg?rev=693316&view=auto
==============================================================================
Binary file - no diff available.

Propchange: portals/jetspeed-2/applications/mfa/WebContent/images/jetspeedlogo98.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: portals/jetspeed-2/applications/mfa/build.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/build.properties?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/build.properties (added)
+++ portals/jetspeed-2/applications/mfa/build.properties Mon Sep  8 16:31:33 2008
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+app.server.home = /jdev/servers/tomcat5
+portal.name = jetspeed
+pa.name = mfa

Added: portals/jetspeed-2/applications/mfa/build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/build.xml?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/build.xml (added)
+++ portals/jetspeed-2/applications/mfa/build.xml Mon Sep  8 16:31:33 2008
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<project name="mfa" default="delta" basedir=".">
+ 	
+<property file="${user.home}/build.properties"/>
+<property file="build.properties"/>
+	
+<target name='delta'>
+	<copy todir="${app.server.home}/webapps/${pa.name}/">
+        <fileset dir="./WebContent/"/>        
+  	</copy>                
+</target>
+	
+<target name='test'>
+	<echo>app server home is ${app.server.home}</echo>
+</target>
+	
+<target name='deploy'>
+	<copy tofile="${app.server.home}/webapps/mfa.war">
+		<fileset file="target/mfa-1.0.war"/>
+	</copy>
+</target>
+	
+</project>
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/pom.xml?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/pom.xml (added)
+++ portals/jetspeed-2/applications/mfa/pom.xml Mon Sep  8 16:31:33 2008
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+  $Id:$
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <prerequisites>
+        <maven>2.0.4</maven>
+    </prerequisites>
+
+    <!-- POM Identification -->
+
+    <artifactId>mfa</artifactId>
+        <groupId>org.apache.portals.applications</groupId>
+        <version>1.0</version>
+    <packaging>war</packaging>
+    <name>MFA Portal Application</name>
+	
+    <properties>
+    	<jetspeed.version>2.1.3</jetspeed.version>
+    	<bridges.version>1.0.4</bridges.version>
+	</properties>	
+	
+    <!-- Dependencies -->
+
+    <dependencies>
+    
+        <dependency>
+            <groupId>commons-configuration</groupId>
+            <artifactId>commons-configuration</artifactId>
+            <version>1.4</version>
+        </dependency>           
+        <dependency>
+            <groupId>org.apache.portals.jetspeed-2</groupId>
+            <artifactId>jetspeed-api</artifactId>
+            <version>${jetspeed.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.portals.bridges</groupId>
+            <artifactId>portals-bridges-common</artifactId>
+            <version>${bridges.version}</version>
+            <scope>provided</scope>
+        </dependency>  
+        <dependency>
+            <groupId>org.apache.portals.jetspeed-2</groupId>
+            <artifactId>jetspeed-webapp-logging</artifactId>
+            <version>${jetspeed.version}</version>            
+            <scope>runtime</scope>
+        </dependency>              
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>jstl</artifactId>
+            <version>1.1.2</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>2.3</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>portlet-api</groupId>
+            <artifactId>portlet-api</artifactId>
+            <version>1.0</version>
+            <scope>provided</scope>
+        </dependency>        
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>standard</artifactId>
+            <version>1.1.2</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>request</artifactId>
+            <version>1.0.1</version>            
+            <scope>runtime</scope>
+        </dependency>
+ 	    <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.14</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <scope>runtime</scope>
+            <version>1.1</version>            
+        </dependency> 	
+    </dependencies>
+
+    <!-- Build Configuration -->
+
+    <build>
+
+        <!-- J2 Standard Directories -->
+        <sourceDirectory>src</sourceDirectory>
+
+        <!-- Resources -->
+        <resources>
+            <resource>
+                <directory>src</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </resource>
+        </resources>
+
+
+        <!-- Plugins -->
+        <plugins>
+                <!-- WAR plugin -->
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-war-plugin</artifactId>
+                    <configuration>
+                        <warSourceDirectory>WebContent</warSourceDirectory>
+                    </configuration>
+                </plugin> 
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                    <debug>true</debug>
+                    <showDeprecation>true</showDeprecation>
+                    <showWarnings>true</showWarnings>
+                    <optimize>false</optimize>
+                    </configuration>
+                </plugin>
+            
+        </plugins>
+
+    </build>
+
+</project>

Added: portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/CaptchaBean.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/CaptchaBean.java?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/CaptchaBean.java (added)
+++ portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/CaptchaBean.java Mon Sep  8 16:31:33 2008
@@ -0,0 +1,54 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.mfa;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface CaptchaBean
+{
+    void init();
+    
+    /**
+     * Get the challenge captcha string that is encoded into an image
+     * @return
+     */
+    String getChallengeId();
+    
+    /**
+     * Get the image name string for the captcha 
+     * @return
+     */
+    String getImageId();
+    
+    /**
+     * Get the image content as a byte array
+     * @return
+     */
+    byte[] getImageBytes();
+    
+    /**
+     * Get the full URL of the image resource
+     * 
+     * @return
+     */
+    String getImageURL();
+    void setImageURL(String url);
+    
+    void setBackgroundImage(byte[] image);
+}
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MFA.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MFA.java?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MFA.java (added)
+++ portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MFA.java Mon Sep  8 16:31:33 2008
@@ -0,0 +1,40 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.mfa;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public final class MFA
+{
+    private static MultiFacetedAuthentication mfa = null;
+    private static Object guard = new Object();
+    
+    public static void setInstance(MultiFacetedAuthentication m)
+    {
+        synchronized (guard)
+        {
+            mfa = m;
+        }   
+    }
+    
+    public static MultiFacetedAuthentication getInstance()
+    {
+        return mfa;
+    }
+}
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MultiFacetedAuthentication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MultiFacetedAuthentication.java?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MultiFacetedAuthentication.java (added)
+++ portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/MultiFacetedAuthentication.java Mon Sep  8 16:31:33 2008
@@ -0,0 +1,32 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.mfa;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface MultiFacetedAuthentication
+{
+    CaptchaBean createCaptcha(HttpServletRequest request);
+    CaptchaBean createCaptcha(HttpServletRequest request, String text);
+    TextToSpeechBean createTextToSpeech(HttpServletRequest request, String text);
+    void destroy();
+    void play(TextToSpeechBean tts);
+}
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/SecurityQuestionBean.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/SecurityQuestionBean.java?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/SecurityQuestionBean.java (added)
+++ portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/SecurityQuestionBean.java Mon Sep  8 16:31:33 2008
@@ -0,0 +1,42 @@
+package org.apache.jetspeed.security.mfa;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class SecurityQuestionBean implements Serializable {
+	private String question1;
+	private String question2;
+	private String question3;
+	
+	public SecurityQuestionBean() {
+		// TODO Auto-generated constructor stub
+	}
+
+	public String getQuestion1() {
+		return question1;
+	}
+
+	public void setQuestion1(String question1) {
+		this.question1 = question1;
+	}
+
+	public String getQuestion2() {
+		return question2;
+	}
+
+	public void setQuestion2(String question2) {
+		this.question2 = question2;
+	}
+
+	public String getQuestion3() {
+		return question3;
+	}
+
+	public void setQuestion3(String question3) {
+		this.question3 = question3;
+	}
+
+}

Added: portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/TextToSpeechBean.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/TextToSpeechBean.java?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/TextToSpeechBean.java (added)
+++ portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/TextToSpeechBean.java Mon Sep  8 16:31:33 2008
@@ -0,0 +1,50 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.mfa;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface TextToSpeechBean
+{    
+    /**
+     * Get the text string to be translated to speech
+     * @return
+     */
+    String getText();
+    
+    /**
+     * Get the audio id  
+     * @return
+     */
+    String getAudioId();
+    
+    /**
+     * Get the audio content as a byte array
+     * @return
+     */
+    byte[] getAudioBytes();
+    
+    /**
+     * Get the full URL of the audio resource
+     * 
+     * @return
+     */
+    String getAudioURL();
+    void setAudioURL(String url);
+}
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaBeanImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaBeanImpl.java?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaBeanImpl.java (added)
+++ portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaBeanImpl.java Mon Sep  8 16:31:33 2008
@@ -0,0 +1,81 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.mfa.impl;
+
+import org.apache.jetspeed.security.mfa.CaptchaBean;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public class CaptchaBeanImpl implements CaptchaBean
+{
+    private CaptchaImageResource cis;
+    private String imageId;
+    private String challengeId;
+    private String imageURL;
+    
+    public CaptchaBeanImpl(CaptchaConfiguration config)
+    {
+        this.cis = new CaptchaImageResource(config);
+        this.challengeId = cis.getChallengeId();
+        this.imageId = CaptchaImageResource.randomString(7, 9);
+    }
+    
+    public CaptchaBeanImpl(CaptchaConfiguration config, String text)
+    {
+    	this.cis = new CaptchaImageResource(config, text);
+    	this.challengeId = cis.getChallengeId();
+    	this.imageId = CaptchaImageResource.randomString(7, 9);
+    }
+    
+    public void setBackgroundImage(byte[] background)
+    {
+        this.cis.setBackgroundImage(background);
+    }
+    
+    public void init()
+    {
+        this.cis.init();
+    }    
+    
+    public String getChallengeId()
+    {
+        return challengeId;
+    }
+    
+    public String getImageId()
+    {
+        return imageId;
+    }    
+        
+    public byte[] getImageBytes()
+    {
+        return cis.getImageBytes();
+    }
+    
+    public String getImageURL()
+    {
+        return imageURL;
+    }
+    
+    public void setImageURL(String url)
+    {
+        this.imageURL = url;
+    }
+    
+}
\ No newline at end of file

Added: portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaConfiguration.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaConfiguration.java?rev=693316&view=auto
==============================================================================
--- portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaConfiguration.java (added)
+++ portals/jetspeed-2/applications/mfa/src/org/apache/jetspeed/security/mfa/impl/CaptchaConfiguration.java Mon Sep  8 16:31:33 2008
@@ -0,0 +1,360 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.security.mfa.impl;
+
+import org.apache.commons.configuration.Configuration;
+
+/**
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public final class CaptchaConfiguration
+{
+    public final String DIRECTORY = "captcha.directory";
+    public final String EFFECTS_NOISE = "captcha.effects.noise";
+    public final String IMAGE_BACKGROUND = "captcha.image.background";
+    public final String USE_IMAGE_BACKGROUND = "captcha.image.background.use";
+    public final String IMAGE_FORMAT = "catcha.image.format";
+    public final String FONT_ANTIALIASING = "captcha.font.antialiasing";
+    public final String FONT_SIZE = "captcha.font.size";
+    public final String FONT_SIZE_RANDOM = "captcha.font.size.random";
+    public final String FONT_NAMES = "captcha.font.names";
+    public final String FONT_STYLE = "captcha.font.style";
+    public final String SCANRATE_SECONDS = "captcha.scanrate.seconds";
+    public final String TIMETOLIVE_SECONDS = "captcha.timetolive.seconds";
+    public final String TEXT_MAXLENGTH = "captcha.text.maxlength";
+    public final String TEXT_MARGIN_LEFT = "captcha.text.margin.left";
+    public final String TEXT_MARGIN_BOTTOM = "captcha.text.margin.bottom";    
+    public final String TEXT_MINLENGTH = "captcha.text.minlength";
+    public final String TEXT_ROTATION = "captcha.text.rotation";
+    public final String TEXT_SHEAR = "captcha.text.shear";
+    public final String TEXT_RISE_RANGE = "captcha.text.rise.range";
+    public final String TEXT_SPACING = "captcha.text.spacing";
+    public final String TIMESTAMP = "captcha.timestamp";
+    public final String TIMESTAMP_24HR = "captcha.timestamp.24hr";
+    public final String TIMESTAMP_TZ = "captcha.timestamp.tz";
+    public final String TIMESTAMP_FONT_SIZE = "captcha.timestamp.font.size";
+    
+    private String directory;
+    private String directoryRealPath;
+    private boolean isEffectsNoise;
+    private String imageBackground;
+    private boolean useImageBackground;
+    private String imageFormat;
+    private boolean isFontAntialiasing;
+    private int fontSize;
+    private boolean isFontSizeRandom;
+    private String[]fontNames;
+    private int fontStyle;
+    private int scanRateSeconds;
+    private int timetoliveSeconds;
+    private int textMaxlength;
+    private int textMarginLeft;
+    private int textMarginBottom;
+    private int textMinlength;
+    private int textRotation;
+    private double textShear;
+    private int textSpacing;
+    private int textRiseRange;
+    private boolean useTimestamp;
+    private boolean useTimestamp24hr;
+    private String timestampTZ;
+    private int timestampFontSize;
+    private Configuration config;
+    
+    public CaptchaConfiguration(Configuration c)
+    {
+        this.config = c;
+        setDirectory(config.getString(DIRECTORY));
+        setEffectsNoise(config.getBoolean(EFFECTS_NOISE));
+        setImageBackground(config.getString(IMAGE_BACKGROUND));
+        setUseImageBackground(config.getBoolean(USE_IMAGE_BACKGROUND));
+        setImageFormat(config.getString(IMAGE_FORMAT));
+        setFontAntialiasing(config.getBoolean(FONT_ANTIALIASING));
+        setFontSize(config.getInt(FONT_SIZE));
+        setFontSizeRandom(config.getBoolean(FONT_SIZE_RANDOM));
+        setFontNames(config.getStringArray(FONT_NAMES));
+        setFontStyle(config.getInt(FONT_STYLE));
+        setScanRateSeconds(config.getInt(SCANRATE_SECONDS));
+        setTimetoliveSeconds(config.getInt(TIMETOLIVE_SECONDS));
+        setTextMaxlength(config.getInt(TEXT_MAXLENGTH));
+        setTextMarginLeft(config.getInt(TEXT_MARGIN_LEFT));
+        setTextMarginBottom(config.getInt(TEXT_MARGIN_BOTTOM));
+        setTextMinlength(config.getInt(TEXT_MINLENGTH));
+        setTextRotation(config.getInt(TEXT_ROTATION));
+        setTextShear(config.getDouble(TEXT_SHEAR));
+        setTextRiseRange(config.getInt(TEXT_RISE_RANGE));
+        setTextSpacing(config.getInt(TEXT_SPACING));
+        setUseTimestamp(config.getBoolean(TIMESTAMP));
+        setUseTimestamp24hr(config.getBoolean(TIMESTAMP_24HR));
+        setTimestampTZ(config.getString(TIMESTAMP_TZ));
+        setTimestampFontSize(config.getInt(TIMESTAMP_FONT_SIZE));
+    }
+    
+    public String getDirectory()
+    {
+        return directory;
+    }
+    
+    public void setDirectory(String directory)
+    {
+        this.directory = directory;
+    }
+        
+    public String[] getFontNames()
+    {
+        return fontNames;
+    }
+    
+    public void setFontNames(String[] fontNames)
+    {
+        this.fontNames = fontNames;
+    }
+    
+    public int getFontSize()
+    {
+        return fontSize;
+    }
+    
+    public void setFontSize(int fontSize)
+    {
+        this.fontSize = fontSize;
+    }
+    
+    public String getImageBackground()
+    {
+        return imageBackground;
+    }
+    
+    public void setImageBackground(String imageBackground)
+    {
+        this.imageBackground = imageBackground;
+    }
+    
+    public String getImageFormat()
+    {
+        return imageFormat;
+    }
+    
+    public void setImageFormat(String imageFormat)
+    {
+        this.imageFormat = imageFormat;
+    }
+    
+    public boolean isEffectsNoise()
+    {
+        return isEffectsNoise;
+    }
+    
+    public void setEffectsNoise(boolean isEffectsNoise)
+    {
+        this.isEffectsNoise = isEffectsNoise;
+    }
+    
+    public boolean isFontAntialiasing()
+    {
+        return isFontAntialiasing;
+    }
+    
+    public void setFontAntialiasing(boolean isFontAntialiasing)
+    {
+        this.isFontAntialiasing = isFontAntialiasing;
+    }
+    
+    public int getScanRateSeconds()
+    {
+        return scanRateSeconds;
+    }
+    
+    public void setScanRateSeconds(int scanRateSeconds)
+    {
+        this.scanRateSeconds = scanRateSeconds;
+    }
+    
+    public int getTextMarginLeft()
+    {
+        return textMarginLeft;
+    }
+    
+    public void setTextMarginLeft(int textMargin)
+    {
+        this.textMarginLeft = textMargin;
+    }
+
+    public int getTextMarginBottom()
+    {
+        return textMarginBottom;
+    }
+    
+    public void setTextMarginBottom(int textMargin)
+    {
+        this.textMarginBottom = textMargin;
+    }
+    
+    public int getTextMaxlength()
+    {
+        return textMaxlength;
+    }
+    
+    public void setTextMaxlength(int textMaxlength)
+    {
+        this.textMaxlength = textMaxlength;
+    }
+    
+    public int getTextMinlength()
+    {
+        return textMinlength;
+    }
+    
+    public void setTextMinlength(int textMinlength)
+    {
+        this.textMinlength = textMinlength;
+    }
+    
+    public int getTextRiseRange()
+    {
+        return textRiseRange;
+    }
+    
+    public void setTextRiseRange(int textRiseRange)
+    {
+        this.textRiseRange = textRiseRange;
+    }
+    
+    public int getTextRotation()
+    {
+        return textRotation;
+    }
+    
+    public void setTextRotation(int textRotation)
+    {
+        this.textRotation = textRotation;
+    }
+    
+    public int getTimetoliveSeconds()
+    {
+        return timetoliveSeconds;
+    }
+    
+    public void setTimetoliveSeconds(int timetoliveSeconds)
+    {
+        this.timetoliveSeconds = timetoliveSeconds;
+    }
+    
+    public boolean isUseTimestamp()
+    {
+        return useTimestamp;
+    }
+    
+    public void setUseTimestamp(boolean useTimestamp)
+    {
+        this.useTimestamp = useTimestamp;
+    }
+    
+    public String getDirectoryRealPath()
+    {
+        return directoryRealPath;
+    }
+    
+    public void setDirectoryRealPath(String directoryRealPath)
+    {
+        this.directoryRealPath = directoryRealPath;
+    }
+    
+    public int getFontStyle()
+    {
+        return fontStyle;
+    }
+    
+    public void setFontStyle(int fontStyle)
+    {
+        this.fontStyle = fontStyle;
+    }
+    
+    public boolean isFontSizeRandom()
+    {
+        return isFontSizeRandom;
+    }
+    
+    public void setFontSizeRandom(boolean isfontSizeRandom)
+    {
+        this.isFontSizeRandom = isfontSizeRandom;
+    }
+    
+    public boolean isUseImageBackground()
+    {
+        return useImageBackground;
+    }
+    
+    public void setUseImageBackground(boolean useImageBackground)
+    {
+        this.useImageBackground = useImageBackground;
+    }
+    
+    public double getTextShear()
+    {
+        return textShear;
+    }
+    
+    public void setTextShear(double textShear)
+    {
+        this.textShear = textShear;
+    }
+    
+    public int getTextSpacing()
+    {
+        return textSpacing;
+    }
+    
+    public void setTextSpacing(int textSpacing)
+    {
+        this.textSpacing = textSpacing;
+    }
+    
+    public boolean isUseTimestamp24hr()
+    {
+        return useTimestamp24hr;
+    }
+    
+    public void setUseTimestamp24hr(boolean useTimestamp24hr)
+    {
+        this.useTimestamp24hr = useTimestamp24hr;
+    }
+    
+    public int getTimestampFontSize()
+    {
+        return timestampFontSize;
+    }
+    
+    public void setTimestampFontSize(int timestampFontSize)
+    {
+        this.timestampFontSize = timestampFontSize;
+    }
+
+    
+    public String getTimestampTZ()
+    {
+        return timestampTZ;
+    }
+
+    
+    public void setTimestampTZ(String timestampTZ)
+    {
+        this.timestampTZ = timestampTZ;
+    }
+    
+}
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org