Hello,

I am having trouble setting up the sunrise authentication
framework. I am using cocoon-2.0.3-dev built with the
scratchpad libs.

I have contructed a login form and an authentication
ressource. When I use the sunRise-auth action to protect
a resource the redirect to the login page always takes
place, even after I have successfully (or so I thought)
logged in.

The login part is working but I don't think the sunRise
context is being created so the next time the protected
resource is accessed I am back at the login form. A cookie
is being set with a jsessioned which, I assummed, indicated
that the session is being created. If I put the following
line in the 'loggedin' page then an error about the unknown
context will be produced:
<sunshine:getxml context="sunRise " path="/authentication/ID"/>

I appreciate that a few similar questions have been asked
before and I have looked at previous messages but I just
cannot spot what I am doing wrong.

This is how the action is defined:

<map:action logger="sitemap.action.sunrise" name="sunRise-auth"
      src="org.apache.cocoon.sunshine.sunrise.acting.AuthAction">
   <handlers>
     <handler name="sbs-handler"
              xmlns:map="http://apache.org/cocoon/sitemap/1.0";
              xmlns:sunshine="http://sunshine.sundn.de/sunshine/1.0";>
       <redirect-to uri="cocoon:///test/auth/loginpage"/>
       <authentication uri="cocoon:raw://authenticate"/>
     </handler>
   </handlers>
</map:action>

This is what I am trying to protect:

<map:match pattern="admin/website/data">
   <map:act type="sunRise-auth">
     <map:parameter name="handler" value="sbs-handler"/>
     <map:call resource="page">
       <map:parameter name="target" value="admin/website/data"/>
       <map:parameter name="style" value="default"/>
     </map:call>
   </map:act>
</map:match>

(a resource is called so that a sub-sitemap can be used
  to retrieve the actual page - there are no sunrise
  components referred to in the sub-sitemap)

The login form and failed login page:

<map:match pattern="auth/login">
     <map:act type="sunRise-login">
     <map:parameter name="handler" value="sbs-handler"/>
     <map:parameter name="parameter_userid" value="request:userid"/>
     <map:parameter name="parameter_password" value="request:passwd"/>
     <map:redirect-to uri="cocoon://auth/loggedin"/>
   </map:act>
   <map:generate src="site/auth/loginfailed.xsp" type="serverpages"/>
   <map:transform src="stylesheets/w3c-default.xsl"/>
   <map:serialize/>
</map:match>

This is my authentication resource:

<map:match pattern="authenticate">
   <map:generate type="serverpages" src="auth/authenticate.xsp"/>
   <map:serialize type="xml"/>
</map:match>

When login 'works' this page is displayed:

<map:match pattern="auth/loggedin">
   <map:act type="sunRise-auth">
     <map:parameter name="handler" value="sbs-handler"/>
     <map:generate src="site/auth/loggedin.xsp" type="serverpages"/>
     <map:transform type="sunShine"/>
     <map:transform src="stylesheets/w3c-default.xsl"/>
     <map:serialize/>
   </map:act>
</map:match>

To anyone who has got this far, thanks for reading :-) Any
suggestions as to what I am doing wrong?

Regards,
Simeon          

-- 
Simeon Walker,                      email: [EMAIL PROTECTED]
School of Biological Sciences,      phone: +44 (0)1248 383702
University of Wales, Bangor,        fax: +44 (0)1248 382569
Gwynedd, LL57 2UW, UK.              www: http://biology.bangor.ac.uk/


---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to