Introduction

The Apache Cocoon Portal is not tied to a specific authentication mechanism. The included demo of the portal in Cocoon uses the authentication framework. It is relativly easy to replace the authentication framework with CoWarp.

Installation

Start with the installation of Cowarp.

Configuration

After configuring the Cowwarp application manager the next step is to add a profile manager for the Cocoon portal. We use the GroupBasedProfileManager that comes with Cocoon:

...
 <component class="org.apache.cocoon.portal.profile.impl.GroupBasedProfileManager" logger="portal" role="org.apache.cocoon.portal.profile.ProfileManager/Cowarp">
   <parameter name="userinfo-provider" value="org.osoco.cowarp.portal.UserInfoProviderImpl"/>
 </component>
...
      

Next, we add the security handler for the portal; we use the same pipeline as the standard demo of Cocoon uses:

...
<component role="org.osoco.cowarp.SecurityHandler/portal" 
           class="org.osoco.cowarp.impl.PipelineSecurityHandler">
    <authentication-resource>cocoon:raw:/sunrise-authuser</authentication-resource>
</component>
...
      

Then we have to configure our portal application. This application get's the configuration for loading and saving profiles - again we use the same mechanism as the demo portal:

...
<component role="org.osoco.cowarp.Application/portal" 
           class="org.osoco.cowarp.portal.StandardPortalApplication" 
           security-handler="portal">
                  <profiles>
                    <copletbasedata-global-load uri="cocoon:raw:/load-global-profile?profile=copletbasedata"/>
                    <copletdata-global-load uri="cocoon:raw:/load-global-profile?profile=copletdata"/>
                    <copletdata-role-load uri="cocoon:raw:/load-role-profile?profile=copletdata"/>
                    <copletdata-user-load uri="cocoon:raw:/load-user-profile?profile=copletdata"/>
                    <copletinstancedata-global-load uri="cocoon:raw:/load-global-profile?profile=copletinstancedata"/>
                    <copletinstancedata-role-load uri="cocoon:raw:/load-role-profile?profile=copletinstancedata"/>
                    <copletinstancedata-user-load uri="cocoon:raw:/load-user-profile?profile=copletinstancedata"/>
                    <copletinstancedata-user-save uri="cocoon:raw:/save-user-profile?profile=copletinstancedata"/>
                    <layout-global-load uri="cocoon:raw:/load-global-profile?profile=layout"/>
                    <layout-role-load uri="cocoon:raw:/load-role-profile?profile=layout"/>
                    <layout-user-load uri="cocoon:raw:/load-user-profile?profile=layout"/>
                    <layout-user-save uri="cocoon:raw:/save-user-profile?profile=layout"/>
                  </profiles>
</component>
...
      

And the final step is to tell the portal to use our new profile manager. Search for the following part in the cocoon.xconf:

...
 <portal name="portal">
   <!-- This is the sample portal: 
        - we use the auth profile manager
   -->
   <profile-manager>org.apache.cocoon.portal.profile.ProfileManager/Auth</profile-manager>
...
      

Change the configuration to use our Cowarp profile manager by replacing the "/Auth" with "/Cowarp":

...
 <portal name="portal">
   <!-- This is the sample portal: 
        - we use the auth profile manager
   -->
   <profile-manager>org.apache.cocoon.portal.profile.ProfileManager/Cowarp</profile-manager>
...
      

Using

The "hardest part" is to change the sitemap of the portal from using the authentication framework to using Cowarp.

TD