A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/670.html

Document ID: 670
Branch: main
Language: default
Name: User Administration (unchanged)
Document Type: Document (unchanged)
Updated on: 8/16/05 1:26:38 PM
Updated by: Helma

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 4534 bytes (previous version: 11419 bytes)
Content diff:
(117 equal lines skipped)
    <p>The <em>delete-role</em> resources deletes a role. The parameters "type" 
with
    the value "role" and "role" with the rolename are passed as parameters.</p>
    
--- <h1>Configuration Summary</h1>
--- 
--- <p>Here is a brief summary of the authentication handler configuration:</p>
--- 
--- <pre>&lt;autentication-manager&gt;
---   &lt;handlers&gt;
---     &lt;handler name="unique"&gt;
---       &lt;!-- The redirect-to resource --&gt;
---       &lt;redirect-to uri="cocoon:raw://loginpage"/&gt;
---       &lt;!-- Authentication resource --&gt;
---       &lt;authentication uri="cocoon:raw://authenticationresource"/&gt;
--- 
---       &lt;load uri="cocoon:raw://authenticationsaveresource"&gt;
---         &lt;!-- optional parameters --&gt;
---       &lt;/load&gt;
---       &lt;!-- optional save resource --&gt;
---       &lt;save uri="cocoon:raw://authenticationsaveresource"&gt;
---         &lt;!-- optional parameters --&gt;
---       &lt;/save&gt;
--- 
---       &lt;applications&gt;
---         &lt;!-- the applications for this handler --&gt;
---         &lt;application name="unique"&gt;
--- 
---           &lt;!-- Loading/Saving --&gt;
---           &lt;load uri="cocoon:raw://loadapp"&gt;
---             &lt;!-- optional --&gt;
---             &lt;!-- optional parameters --&gt;
---           &lt;/load&gt;
---           &lt;save uri="cocoon:raw://saveapp"&gt;
---             &lt;!-- optional --&gt;
---             &lt;!-- optional parameters --&gt;
---           &lt;/save&gt;
---           &lt;!-- module configurations: --&gt;
--- 
---           &lt;configuration name="portal"&gt;
---             ...portal configuration
---           &lt;/configuration&gt;
---         &lt;/application&gt;
---       &lt;/applications&gt;
--- 
---     &lt;/handler&gt;
---   &lt;/handlers&gt;
--- &lt;/autentication-manager&gt;</pre>
--- 
--- <h1>Pipeline Patterns</h1>
--- 
--- <p>As explained in the previous chapters, the framework uses the
--- <em>auth-protect</em> action for authentication and protecting documents. 
This
--- chapter shows some commonly used pipeline patterns.</p>
--- 
--- <h2>Single protected document</h2>
--- 
--- <p>For protecting a document with an authentication handler only the
--- <em>auth-protect</em> action with the parameter configuration for the 
handler is
--- required.</p>
--- 
--- <p>Pattern:</p>
--- 
--- <ol>
--- <li>Pipeline matching</li>
--- <li>Using the <em>auth-protect</em> action for protecting</li>
--- </ol>
--- 
--- <p>Example:</p>
--- 
--- <pre>&lt;map:match pattern="protected"&gt;
---   &lt;map:act type="auth-protect"&gt;  &lt;!-- protect the resource --&gt;
---     &lt;map:parameter name="handler" value="myhandler"/&gt;
--- 
---     &lt;map:generate src="resource.xml"/&gt;
---     &lt;map:transform src="toHTML"/&gt;
---     &lt;map:serialize/&gt;
---   &lt;/map:act&gt;
--- &lt;/map:match&gt;</pre>
--- 
--- <p>It is very important that the <em>auth-protect</em> action wraps the real
--- pipeline, as the pipeline is only invoked if the action grants access. The
--- matching must be done before the action is checked as the action performs a
--- redirect for this document.</p>
--- 
--- <h2>Multiple protected documents</h2>
--- 
--- <p>Often you want to protect a bunch of documents in the same way. One 
solution
--- is to use the single protected document pattern for each document. With the
--- multiple protected document pattern you only have to use the action once 
for all
--- documents and not within each document pipeline.</p>
--- 
--- <p>The prerequisite for this is a common matching pattern for the 
documents:</p>
--- 
--- <ol>
--- <li>Pipeline pattern matching</li>
--- <li>Using the <em>auth-protect</em> action for protection</li>
--- <li>Pipeline matching</li>
--- </ol>
--- 
--- <p>Example:</p>
--- 
--- <pre>&lt;map:match pattern="protected-*"&gt;
---   &lt;map:act type="auth-protect"&gt; &lt;!-- protect the resource --&gt;
---     &lt;map:parameter name="handler" value="myhandler"/&gt;
--- 
---     &lt;map:match pattern="protected-first"&gt;
---       &lt;map:generate src="resource1.xml"/&gt;
---       &lt;map:transform src="toHTML"/&gt;
---       &lt;map:serialize/&gt;
---     &lt;/map:match&gt;
---         ....
---     &lt;map:match pattern="protected-second"&gt;
---       &lt;map:generate src="resource2.xml"/&gt;
---       &lt;map:transform src="toHTML"/&gt;
---       &lt;map:serialize/&gt;
---     &lt;/map:match&gt;
---   
---   &lt;/map:act&gt;
--- &lt;/map:match&gt;</pre>
--- 
--- <p>Very important - as explained with the single document pattern - is the
--- leading match before the action is performed. The subsequent matches are
--- required to check which pipeline to use.</p>
--- 
--- <h2>Controlling the Application Flow</h2>
--- 
--- <p>If you want to create documents which behave different depending if you 
are
--- logged in or not, the <em>auth-loggedIn</em> action is the component to use 
to
--- control your application flow. This action checks if the user is 
authenticated
--- for a given handler and calls all sitemap components inside the <em>act</em>
--- tag.</p>
--- 
--- <pre>&lt;map:match pattern="startpage"&gt;
--- 
---   &lt;map:act type="auth-loggedIn"&gt;  &lt;!-- check authentication --&gt;
---     &lt;map:parameter name="handler" value="myhandler"/&gt;
--- 
---     &lt;map:redirect-to uri="loggedInStartPage"/&gt;
---   &lt;/map:act&gt;
--- 
---   &lt;map:generate src="startpage.xml"/&gt;
---   &lt;map:transform src="toHTML"/&gt;
---   &lt;map:serialize/&gt;
--- &lt;/map:match&gt;</pre>
--- 
--- <p>In the example above, if the user is already logged he is redirected to 
the
--- <em>loggedInStartPage</em> document. If he is not logged in for the given
--- handler, the usual start page is generated.</p>
--- 
--- <p>The <em>auth-protect</em> action returns - if the user is logged in for 
the
--- given handler - all values from the context to the sitemap, e.g. ID, role 
etc.
--- These values can be used within the other components:</p>
--- 
--- <pre>&lt;map:match pattern"protected"&gt;
---   &lt;map:act type="auth-protect"&gt;  &lt;!-- protect the resource --&gt;
---     &lt;map:parameter name="handler" value="myhandler"/&gt;
--- 
---     &lt;!-- Append the ID of the user to the file name --&gt;
---     &lt;map:generate src="resource_{ID}.xml"/&gt;
---     &lt;map:transform src="toHTML"/&gt;
---     &lt;map:serialize/&gt;
--- 
---   &lt;/map:act&gt;
--- &lt;/map:match&gt;</pre>
--- 
--- <p>But the <em>auth-loggedIn</em> action does not give the included pipeline
--- access to the authentication context belonging to the handler. If you want 
this,
--- you have to nest the <em>auth-protect</em> action inside!</p>
--- 
--- <pre>&lt;map:match pattern"start"&gt;
--- 
---   &lt;map:act type="auth-loggedIn"&gt;  &lt;!-- check authentication --&gt;
---     &lt;map:parameter name="handler" value="myhandler"/&gt;
--- 
---     &lt;map:act type="auth-protect"&gt;  &lt;!-- give access to the context 
--&gt;
---       &lt;map:parameter name="handler" value="myhandler"/&gt;
--- 
---       &lt;map:generate src="getinfofromcontext.xml"/&gt;
---       &lt;map:transform type="session"/&gt;
---       &lt;map:transform src="toHTML"/&gt;
---       &lt;map:serialize/&gt;
---     &lt;/map:act&gt;
---   &lt;/map:act&gt;
--- 
--- &lt;/map:match&gt;</pre>
--- 
--- <h2>Session Handling</h2>
--- 
--- <p>If a user is authenticated, the user has a session. However, care has to 
be
--- taken that the session tracking works, which means that Cocoon can detect 
that a
--- follow up request of the user belongs to the same session.</p>
--- 
--- <p>The easiest way is to use the <em>encodeURL</em> transformer as the last
--- transformation step in your pipeline. For more information about session
--- handling, have a look in the <a href="daisy:607">chapter about 
sessions</a>.</p>
--- 
    </body>
    </html>


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes