This is the core Class I use to Authenticated/Authorize:

Place the "auth-fw" in your "WEB-INF\lib"

In the cocoon.xconf place the following snipet:
--START--
<component
class="com.electroplus.components.auth.impl.DefaultAuthenticationManager" 
logger="core.auth-manager" 
role="com.electroplus.components.auth.AuthenticationManager">
<anonymous id="anonymous" display-name="Anonymous" pool-name="eplus"/>
<role name="user" class="com.electroplus.components.auth.users.User"/>
<role name="anonymous"
class="com.electroplus.components.auth.users.AnonymousUser"/>
<role name="auth-user"
class="com.electroplus.components.auth.users.AuthenticatedUser"/> 
<role name="customer"
class="com.electroplus.components.auth.users.CustomerUser"/>
<role name="resaller"
class="com.electroplus.components.auth.users.ResallerUser"/>
<role name="operator"
class="com.electroplus.components.auth.users.OperatorUser"/>
<role name="administrator"
class="com.electroplus.components.auth.users.AdministratorUser"/>
</component>
--END--

Add the following matcher to your sitemap 

<map:matcher logger="sitemap.selector.roles" name="role"
src="com.electroplus.matching.RoleMatcher"/>


Now you can protected your resources with a matcher like

 <map:match pattern="*.pdf">
   <map:match type="role" pattern="auth-user">
     <!-- your resource -->
   <map:match>
   <map:redirect-to uri="access-error.html"/>
 </map:match>



On Mon, 2003-07-07 at 01:10, Adam Flegman wrote: 
> Hi Nuno,
> 
> This sounds exactly like what I am asking for :-)
> 
> I read a few examples about the authentication framework and thought it was
> what I would need.
> 
> I would be most grateful for any java code snippets you may have, and even more
> so for the cocoon configuration related code samples that show how you tell
> cocoon to actually protect your resources with the authorisation classes.
> 
> 
> Many thanks again for taking the time to reply,
> 
> 
> Adam.



-- 

Nuno Santos <[EMAIL PROTECTED]>

Attachment: auth-fw.jar
Description: application/jar

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

Reply via email to