OK. I have read and read and read and I still don't get it.

I am using Cocoon 2.0.4 and am able to use the sunRise action to direct the
user to a protected resource. However, according to the docs on the
authentication framework, you are supposed to be able to read info from the
authentication resource into an xml document from the session context
created by the authentication action. (Or am I missing something?)

I am using the usual pipeline setup, but where I hit a snag is being able to
pull any of the authentication info (such as the content of the
authentication/ID element) into my protected document.

I have used (sunshine:getxml context="authentication"
path="/authentication/ID"/> and (session:getxml context="authentication"
path="/authentication/ID"/> in both xml doc and xsl stylesheet, using the
namespace 'xmlns:sunshine="http://cocoon.apache.org/sunshine/1.0";'

To no avail. What am I missing?

<map:match pattern="">
    <map:redirect-to uri="login"/>
</map:match>

<map:match pattern="login">
    <map:generate src="loginpage.xml"/>
    <map:transform src="loginpage.xsl"/>
    <map:transform type="encodeURL"/>
    <map:serialize/>
</map:match>
<map:match pattern="do-login">
    <map:act type="login">
        <map:parameter name="handler" value="auth-handler"/>
        <map:parameter name="parameter_name" value="request:name"/>
        <map:parameter name="parameter_password" value="request:password"/>
<!-- If authentication successful. -->
        <map:redirect-to uri="protected"/>
    </map:act>
<!-- If authentication fails. -->
    <map:generate src="login-failed.xml"/>
    <map:transform src="login-failed.xsl"/>
    <map:serialize/>
</map:match>
<!-- =======This is the authentication resource =============== -->
<map:match pattern="authuser-db">
    <map:generate src="user-db.xml"/>
    <map:transform type="xslt" src="user-db-prep.xsl">
        <map:parameter name="use-request-parameters" value="true"/>
        <map:parameter name="use-session-info" value="true"/>
    </map:transform>
    <map:transform type="sql">
        <map:parameter name="use-connection" value="pondsprings"/>
    </map:transform>
    <map:transform type="xslt" src="user-db.xsl">
        <map:parameter name="use-request-parameters" value="true"/>
        <map:parameter name="use-session-info" value="true"/>
    </map:transform>
    <map:serialize type="xml"/>
</map:match>
<map:match pattern="protected">
    <map:act type="auth">
        <map:parameter name="handler" value="auth-handler"/>
        <map:parameter name="use-session-info" value="true"/>
        <map:generate src="resource.xml"/>
    </map:act>
    <map:transform src="resource.xsl"/>
    <map:transform type="encodeURL"/>
    <map:serialize/>
</map:match>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to