You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Simeon Walker <si...@sbs.bangor.ac.uk> on 2002/07/05 11:30:39 UTC

sunrise: protected page always redirects to login form

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: simeon@sbs.bangor.ac.uk
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: sunrise: protected page always redirects to login form

Posted by Simeon Walker <si...@sbs.bangor.ac.uk>.
Hi,

I had to use '/test/auth/loggedin' as the redirect url to allow
for the ProxyPassReverse directive in Apache (this is not a problem,
it's the same if I use port 8080 directly).

The errors still occurs. The only visible difference is that the
JSESSIONID is now appended to the url (should this happen when
a cookie with the same ID has been set?)

Regards,
Simeon

Carsten Ziegeler wrote:
> Ok, I think I know your problem now: the redirect you do after
> a successful login is an internal one (which is usually not wrong,
> but it seems that in this case some things are broken).
> 
> Please try changing the redirect to an external one, like
> <map:redirect-to uri="loggedin"/>
> 
> Does this then work?
> 
> Carsten
> 
> 
>>-----Original Message-----
>>From: Simeon Walker [mailto:simeon@sbs.bangor.ac.uk]
>>Sent: Friday, July 05, 2002 12:57 PM
>>To: cocoon-users@xml.apache.org
>>Subject: Re: sunrise: protected page always redirects to login form
>>
>>
>>Hi,
>>
>>I have attached most of the sitemap.log fro, i.e. from where
>>the transformer starts processing the page right up until the
>>request ends.
>>
>>None of the other logs show any errors or exceptions.
>>
>>Regards,
>>Simeon
>>
>>Carsten Ziegeler wrote:
>>
>>>Simeon Walker wrote:
>>>
>>>
>>>><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?
>>>>
>>>
>>>
>>>Everything looks ok to me. The exception you get is really that the
>>>context "sunRise" does not exist? Because this means that the
>>>above pipeline is executed, so sunRise detects that you are logged
>>>in using the "sbs-handler".
>>>Could you please send the exception message?
>>>
>>>Carsten 
>>>
>>>Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
>>>------------------------------------------------------------------
>>>             Cocoon Consulting, Training and Projects
>>>------------------------------------------------------------------
>>>mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
>>>                    http://ziegeler.bei.t-online.de
>>>
>>>
>>>---------------------------------------------------------------------
>>>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>
>>>
>>
>>-- 
>>Simeon Walker,                      email: simeon@sbs.bangor.ac.uk
>>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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 


-- 
Simeon Walker,                      email: simeon@sbs.bangor.ac.uk
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: sunrise: protected page always redirects to login form

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Ok, I think I know your problem now: the redirect you do after
a successful login is an internal one (which is usually not wrong,
but it seems that in this case some things are broken).

Please try changing the redirect to an external one, like
<map:redirect-to uri="loggedin"/>

Does this then work?

Carsten

> -----Original Message-----
> From: Simeon Walker [mailto:simeon@sbs.bangor.ac.uk]
> Sent: Friday, July 05, 2002 12:57 PM
> To: cocoon-users@xml.apache.org
> Subject: Re: sunrise: protected page always redirects to login form
> 
> 
> Hi,
> 
> I have attached most of the sitemap.log fro, i.e. from where
> the transformer starts processing the page right up until the
> request ends.
> 
> None of the other logs show any errors or exceptions.
> 
> Regards,
> Simeon
> 
> Carsten Ziegeler wrote:
> > Simeon Walker wrote:
> > 
> >><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?
> >>
> > 
> > 
> > Everything looks ok to me. The exception you get is really that the
> > context "sunRise" does not exist? Because this means that the
> > above pipeline is executed, so sunRise detects that you are logged
> > in using the "sbs-handler".
> > Could you please send the exception message?
> > 
> > Carsten 
> > 
> > Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
> > ------------------------------------------------------------------
> >              Cocoon Consulting, Training and Projects
> > ------------------------------------------------------------------
> > mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
> >                     http://ziegeler.bei.t-online.de
> > 
> > 
> > ---------------------------------------------------------------------
> > 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>
> > 
> 
> 
> -- 
> Simeon Walker,                      email: simeon@sbs.bangor.ac.uk
> 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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: sunrise: protected page always redirects to login form

Posted by Simeon Walker <si...@sbs.bangor.ac.uk>.
Hi,

I have attached most of the sitemap.log fro, i.e. from where
the transformer starts processing the page right up until the
request ends.

None of the other logs show any errors or exceptions.

Regards,
Simeon

Carsten Ziegeler wrote:
> Simeon Walker wrote:
> 
>><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?
>>
> 
> 
> Everything looks ok to me. The exception you get is really that the
> context "sunRise" does not exist? Because this means that the
> above pipeline is executed, so sunRise detects that you are logged
> in using the "sbs-handler".
> Could you please send the exception message?
> 
> Carsten 
> 
> Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
> ------------------------------------------------------------------
>              Cocoon Consulting, Training and Projects
> ------------------------------------------------------------------
> mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
>                     http://ziegeler.bei.t-online.de
> 
> 
> ---------------------------------------------------------------------
> 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>
> 


-- 
Simeon Walker,                      email: simeon@sbs.bangor.ac.uk
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/

RE: sunrise: protected page always redirects to login form

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Simeon Walker wrote:
> 
> <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?
> 

Everything looks ok to me. The exception you get is really that the
context "sunRise" does not exist? Because this means that the
above pipeline is executed, so sunRise detects that you are logged
in using the "sbs-handler".
Could you please send the exception message?

Carsten 

Carsten Ziegeler     Chief Architect     Open Source Group, S&N AG
------------------------------------------------------------------
             Cocoon Consulting, Training and Projects
------------------------------------------------------------------
mailto:cziegeler@s-und-n.de                  http://www.s-und-n.de
                    http://ziegeler.bei.t-online.de


---------------------------------------------------------------------
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>