cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Authentication - Accessing The Context
Date Mon, 31 Mar 2003 08:28:40 GMT
I'm using the authentication framework in version 2.1 of cocoon.

I can get the system to authenticate a user and then re-direct to
the correct page based on whether they were authenticated or

However, I'm having a problem trying to retrieve information from
the 'authentication' context of the session when the user is accepted.
I get a context does not exist error when I try and access the context
in login_ok.xml. 

If I switch logging to DEBUG level I get the following error before the
user is authenticated.

[NamespaceNormalizingDOMStreamer] Encountered a 
DOM Element without a localName. DOM Level 1 trees 
are not supported by this DOMStreamer.

I think it occurs when the Authentication system
attempts to write the <authentication> node that I return from check.xsp
to the log file.

What am I missing ???

Also is it possible to access the information stored in the 
context via 'xsp-session' in an XSP.



====================== sitemap.xmap 
          <handler name="global">
            <redirect-to uri="cocoon://login_page"/>
            <authentication uri="cocoon:raw://check"/>
      <map:match pattern="check">
        <map:generate type="serverpages" src="check.xsp"/>
        <map:serialize type="xml"/>
      <map:match pattern="login_page">
        <map:read mime-type="text/xhtml" src="login_page.html"/>
      <map:match pattern="login_ok">
        <map:generate src="login_ok.xml"/>
        <map:transform type="session"/>
        <map:serialize type="xml"/>
      <map:match pattern="login">
        <map:act type="auth-login">
          <map:parameter name="handler" value="global"/>
          <map:parameter name="parameter_userid" value="{request-param:name}"/>
          <map:parameter name="parameter_password" value="{request-param:password}"/>
          <map:redirect-to uri="login_ok"/>
        <map:read mime-type="text/html" src="login_failed.html"/>
      <map:match pattern="logout">
        <map:act type="auth-logout">
          <map:parameter name="handler" value="global"/>
          <map:redirect-to uri="login_page"/>

========================== login_ok.xml 
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:session="" >
        <session:getxml context="authentication" path="/authentication/ID" />

========================= check.xsp 
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xsl"?>

<xsp:page        language="java" 
                        xmlns:log="" >

                                select id, site from users where username 
= '<xsp-request:get-parameter name="userid" />' and password = '<xsp-request:get-parameter
name="password" />'
                                        <ID><esql:get-int column="id" /></ID>
                                        <data><esql:get-string column="site" /></data>
                                <data>No match found - <xsp-request:get-query-string
as="string" /></data>

View raw message