The last thread I started on this topic stopped, so I repost and try my
luck.
Hi,
We use the Coocoon authentication block in our web app through the
following dependency in our pom.xml:
<dependency>
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-auth-impl</artifactId>
<version>1.0.0</version>
</dependency>
In our Spring configuration we have declated a simple security handler
and a standard application:
<bean name="org.apache.cocoon.auth.SecurityHandler/Sublima"
class="com.computas.sublima.app.controller.admin.LoginController"
scope="singleton">
</bean>
<bean name="org.apache.cocoon.auth.Application/Sublima"
class="org.apache.cocoon.auth.impl.StandardApplication"
scope="singleton">
<property name="securityHandler"
ref="org.apache.cocoon.auth.SecurityHandler/Sublima"/>
</bean>
This is used in the sitemap in the following way:
<map:match pattern="do-login">
<map:act type="cauth-login">
<map:parameter name="application" value="Sublima"/>
<map:parameter name="name" value="{request-param:username}"/>
<map:parameter name="password" value="{request-param:password}"/>
<map:redirect-to uri="admin"/>
</map:act>
<map:redirect-to uri="{request:contextPath}/login"/>
</map:match>
The Java code to handle the login is as follows (snippet):
http://pastebin.com/m77ef2312
When ie. the username does not exist, the code throws an
AuthenticationException and the stacktrace is presented to the user. We
want the user to be directed back to the login page with the exception
message as an text explaining what went wrong. How do we do this?
Where is the exception supposed to be handled?
Is something missing, ie. a authentication handler of some sort?
I don't see how Cocoon handles the thrown exception between the Java
code and the sitemap where it redirects upon failure.
- Magnus
15. september 2008 flytter Computas til nye lokaler på Lysakerlokket. Vår nye
kontoradresse blir Lysaker Torg 45.
Postadressen vil fremdeles være Postboks 482, 1327 Lysaker.
I den forbindelse går vi over til mobil telefonløsning, for kontakt med
ansatte i Computas kan du ringe sentralbordet på samme telefonnummer som
tidligere: 67 83 10 00, eller direkte på deres mobiltelefon. Vårt faksnummer
forblir også uendret: 67831001