You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Ritter, Tony G" <to...@lmco.com> on 2002/09/26 20:27:45 UTC
sunRise: How do I display failure information to a user when Aut hentication fails
Hello all,
Has anyone successfully implemented a clean solution on passing data
from a failed authentication back to the client. All of the documentation
refers to the ability to do it but I have not found an example on how to
pick up the context "temp" informtion in a XML or XSP form. There is a lot
of references to possibilities but no concrete explanation. Any help would
be appreciated. Any ideas ??
Cocoon Version: 2.0.3
Session Namespace: http://cocoon.apache.org/session/1.0
Sunshine Namespace: http://cocoon.apache.org/sunshine/1.0
----- SITEMAP snippet: ------
<map:match pattern="view/html/ras-login">
<map:act type="create-session"/>
<map:act type="sunRise-login">
<map:parameter name="handler" value="ras-handler"/>
<map:parameter name="parameter_name" value="request:name"/>
<map:parameter name="parameter_password"
value="request:password"/>
<!-- If the authentication is successfull then this redirect will
be performed -->
<map:redirect-to uri="ras-portal"/>
</map:act>
<!-- authentication failed: -->
<map:generate src="authen/loginFailed.xml" />
<map:transform type="sunShine" />
<map:serialize type="xml" />
</map:match>
----- loginFailed.xml ------
<?xml version="1.0"?>
<page xmlns:session="http://cocoon.apache.org/session/1.0"
xmlns:sunshine="http://cocoon.apache.org/sunshine/1.0" >
<sunshine><sunshine:getxml context="temp"
path="/authentication/data">empty set</sunshine:getxml></sunshine>
</page>
----- Form Output ------
<?xml version="1.0" encoding="UTF-8" ?>
<page xmlns:session="http://cocoon.apache.org/session/1.0"
xmlns:sunshine="http://cocoon.apache.org/sunshine/1.0">
<sunshine:action>empty set</sunshine:action>
</page>
----- Sitemap trace information ------
DEBUG (2002-09-26) 11:21.59:206 [core.sunrise]
(/ras/view/html/ras-login) Thread-10/SunRise: end invoking auth resource
DEBUG (2002-09-26) 11:21.59:206 [core.sunrise]
(/ras/view/html/ras-login) Thread-10/SunRise: BEGIN
isValidAuthenticationFragment fragment=[#document-fragment: null]
DEBUG (2002-09-26) 11:21.59:206 [core.sunrise]
(/ras/view/html/ras-login) Thread-10/SunRise: END
isValidAuthenticationFragment valid=false
INFO (2002-09-26) 11:21.59:206 [core.sunrise]
(/ras/view/html/ras-login) Thread-10/SunRise: sunRise: Failed authentication
using handler 'ras-handler'
DEBUG (2002-09-26) 11:21.59:226 [core.sunrise]
(/ras/view/html/ras-login) Thread-10/SunRise: end authentication
DEBUG (2002-09-26) 11:21.59:226 [core.sunrise]
(/ras/view/html/ras-login) Thread-10/SunRise: END authenticate
fragment=[#document-fragment: null]
DEBUG (2002-09-26) 11:21.59:246 [core.event-pipeline]
(/ras/view/html/ras-login) Thread-10/CachingEventPipeline: Caching content
for further requests of 'view/html/ras-login'.
DEBUG (2002-09-26) 11:21.59:267 [core.sunshine]
(/ras/view/html/ras-login) Thread-10/SunShine: BEGIN setup
objectModel={httpresponse=org.apache.coyote.tomcat4.CoyoteResponseFacade@6e8
f94, response=org.apache.cocoon.environment.http.HttpResponse@143dc4,
notifying-object=org.apache.cocoon.components.notification.SimpleNotifyingBe
an@633d51, context=org.apache.cocoon.environment.http.HttpContext@4eaec9,
request=org.apache.cocoon.environment.http.HttpRequest@3533b8,
httprequest=org.apache.coyote.tomcat4.CoyoteRequestFacade@569c60,
httpservletcontext=org.apache.catalina.core.ApplicationContextFacade@3468f4}
DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: BEGIN
processInputFields
DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: END
processInputFields
DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: END
setup
DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: BEGIN
streamContextFragment name=temp, path=/authentication/data,
consumerorg.apache.cocoon.sunshine.transformation.SunShineTransformer@4ffc79
DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: END
streamContextFragment streamed=false
DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: BEGIN
streamContextFragment name=sunRise, path=/authentication/data,
consumerorg.apache.cocoon.sunshine.transformation.SunShineTransformer@4ffc79
DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
Thread-10/XSLTProcessorImpl: XSLTProcessorImpl component initialized.
DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
Thread-10/XSLTProcessorImpl: XSLTProcessorImpl getTemplates: stylesheet
file:/D:/RASDPD/CD_IMAGE1d0/tomcat/webapps/ras/view/html/error2html.xsl
DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
Thread-10/XSLTProcessorImpl: Creating new Templates for
file:/D:/RASDPD/CD_IMAGE1d0/tomcat/webapps/ras/view/html/error2html.xsl
DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
Thread-10/XSLTProcessorImpl: Source =
org.apache.cocoon.components.source.FileSource@6d2380, templatesHandler =
org.apache.xalan.processor.StylesheetHandler@35b1f3
Antone Ritter
Lockheed Martin Aeronautics Company
JSF - Resource Access System
MZ 1700
PO Box 748
Fort Worth, TX 76101
(817) 777-1552
<<Antone Ritter (E-mail).vcf>>
RE: sunRise: How do I display failure information to a user when Aut hentication fails
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi,
if you use 2.0.x the information is not stored in the temporary context
but in a request attribute named
"org.apache.cocoon.sunshine.sunrise.LoginFailedFor"
appended by the handler name.
This changed for the "real" version in C2.1, where the information
is stored in the temporary context.
HTH
Carsten
> -----Original Message-----
> From: Ritter, Tony G [mailto:tony.g.ritter@lmco.com]
> Sent: Thursday, September 26, 2002 8:28 PM
> To: 'cocoon-users@xml.apache.org'
> Subject: sunRise: How do I display failure information to a user when
> Aut hentication fails
>
>
> Hello all,
>
> Has anyone successfully implemented a clean solution on passing data
> from a failed authentication back to the client. All of the documentation
> refers to the ability to do it but I have not found an example on how to
> pick up the context "temp" informtion in a XML or XSP form.
> There is a lot
> of references to possibilities but no concrete explanation. Any
> help would
> be appreciated. Any ideas ??
>
> Cocoon Version: 2.0.3
> Session Namespace: http://cocoon.apache.org/session/1.0
> Sunshine Namespace: http://cocoon.apache.org/sunshine/1.0
>
>
> ----- SITEMAP snippet: ------
>
> <map:match pattern="view/html/ras-login">
> <map:act type="create-session"/>
> <map:act type="sunRise-login">
> <map:parameter name="handler" value="ras-handler"/>
> <map:parameter name="parameter_name" value="request:name"/>
> <map:parameter name="parameter_password"
> value="request:password"/>
> <!-- If the authentication is successfull then this
> redirect will
> be performed -->
> <map:redirect-to uri="ras-portal"/>
> </map:act>
>
> <!-- authentication failed: -->
> <map:generate src="authen/loginFailed.xml" />
> <map:transform type="sunShine" />
> <map:serialize type="xml" />
> </map:match>
>
>
>
> ----- loginFailed.xml ------
>
> <?xml version="1.0"?>
> <page xmlns:session="http://cocoon.apache.org/session/1.0"
> xmlns:sunshine="http://cocoon.apache.org/sunshine/1.0" >
>
> <sunshine><sunshine:getxml context="temp"
> path="/authentication/data">empty set</sunshine:getxml></sunshine>
>
> </page>
>
>
>
> ----- Form Output ------
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <page xmlns:session="http://cocoon.apache.org/session/1.0"
> xmlns:sunshine="http://cocoon.apache.org/sunshine/1.0">
> <sunshine:action>empty set</sunshine:action>
> </page>
>
>
> ----- Sitemap trace information ------
>
> DEBUG (2002-09-26) 11:21.59:206 [core.sunrise]
> (/ras/view/html/ras-login) Thread-10/SunRise: end invoking auth resource
> DEBUG (2002-09-26) 11:21.59:206 [core.sunrise]
> (/ras/view/html/ras-login) Thread-10/SunRise: BEGIN
> isValidAuthenticationFragment fragment=[#document-fragment: null]
> DEBUG (2002-09-26) 11:21.59:206 [core.sunrise]
> (/ras/view/html/ras-login) Thread-10/SunRise: END
> isValidAuthenticationFragment valid=false
> INFO (2002-09-26) 11:21.59:206 [core.sunrise]
> (/ras/view/html/ras-login) Thread-10/SunRise: sunRise: Failed
> authentication
> using handler 'ras-handler'
> DEBUG (2002-09-26) 11:21.59:226 [core.sunrise]
> (/ras/view/html/ras-login) Thread-10/SunRise: end authentication
> DEBUG (2002-09-26) 11:21.59:226 [core.sunrise]
> (/ras/view/html/ras-login) Thread-10/SunRise: END authenticate
> fragment=[#document-fragment: null]
> DEBUG (2002-09-26) 11:21.59:246 [core.event-pipeline]
> (/ras/view/html/ras-login) Thread-10/CachingEventPipeline: Caching content
> for further requests of 'view/html/ras-login'.
> DEBUG (2002-09-26) 11:21.59:267 [core.sunshine]
> (/ras/view/html/ras-login) Thread-10/SunShine: BEGIN setup
> objectModel={httpresponse=org.apache.coyote.tomcat4.CoyoteResponse
> Facade@6e8
> f94, response=org.apache.cocoon.environment.http.HttpResponse@143dc4,
> notifying-object=org.apache.cocoon.components.notification.SimpleN
> otifyingBe
> an@633d51, context=org.apache.cocoon.environment.http.HttpContext@4eaec9,
> request=org.apache.cocoon.environment.http.HttpRequest@3533b8,
> httprequest=org.apache.coyote.tomcat4.CoyoteRequestFacade@569c60,
> httpservletcontext=org.apache.catalina.core.ApplicationContextFaca
> de@3468f4}
> DEBUG [core.sunshine] (/ras/view/html/ras-login)
> Thread-10/SunShine: BEGIN
> processInputFields
> DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: END
> processInputFields
> DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: END
> setup
> DEBUG [core.sunshine] (/ras/view/html/ras-login)
> Thread-10/SunShine: BEGIN
> streamContextFragment name=temp, path=/authentication/data,
> consumerorg.apache.cocoon.sunshine.transformation.SunShineTransfor
> mer@4ffc79
> DEBUG [core.sunshine] (/ras/view/html/ras-login) Thread-10/SunShine: END
> streamContextFragment streamed=false
> DEBUG [core.sunshine] (/ras/view/html/ras-login)
> Thread-10/SunShine: BEGIN
> streamContextFragment name=sunRise, path=/authentication/data,
> consumerorg.apache.cocoon.sunshine.transformation.SunShineTransfor
> mer@4ffc79
> DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
> Thread-10/XSLTProcessorImpl: XSLTProcessorImpl component initialized.
> DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
> Thread-10/XSLTProcessorImpl: XSLTProcessorImpl getTemplates: stylesheet
> file:/D:/RASDPD/CD_IMAGE1d0/tomcat/webapps/ras/view/html/error2html.xsl
> DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
> Thread-10/XSLTProcessorImpl: Creating new Templates for
> file:/D:/RASDPD/CD_IMAGE1d0/tomcat/webapps/ras/view/html/error2html.xsl
> DEBUG [core.xslt-processor] (/ras/view/html/ras-login)
> Thread-10/XSLTProcessorImpl: Source =
> org.apache.cocoon.components.source.FileSource@6d2380, templatesHandler =
> org.apache.xalan.processor.StylesheetHandler@35b1f3
>
> Antone Ritter
> Lockheed Martin Aeronautics Company
> JSF - Resource Access System
> MZ 1700
> PO Box 748
> Fort Worth, TX 76101
> (817) 777-1552
> <<Antone Ritter (E-mail).vcf>>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>