Personally I made a Generator that generates the XML used in the portal to identify users and roles. It authenticates against a DB inside a session bean, and this method returns the role of the user sent back again into the portal framework through the <authentication> XML.

public class AuthenticationGenerator extends AbstractGenerator {
private static Category cat = Category.getInstance("cocoon.generators.AuthenticationGenerator");


        private String generateXml(String user, String role){
                String xml="<authentication>" +
            "<ID>" + user + "</ID>"+
            "<role>" + role + "</role>"+
            "<data>" +
            "</data>" +
                "</authentication>";    
                return xml;
        }


...... parameter and error handling skipped...

                        String role=sessionBean.verifyAndGetCustomerRole(userName, 
password);
                                if (role==null)
                                        throw new ProcessingException(new Exception("Login 
failed"));
                        else
CocoonUtil.sendToConsumer(generateXml(userName, role), xmlConsumer);


Martin Rusnak wrote:
Dear All,

I use my own authenticator class which implements interface:

org.apache.cocoon.webapps.authentication.components.Authenticator

I configured it as it is described in the documentation. Here is the handler configuration:

<handler name="portalhandler">
    <redirect-to uri="cocoon:/sunspotdemoportal"/>
    <authentication authenticator="mypkg.MyAuthenticator"/>
</handler>

I want to do custom database query to verify the user credentials,
but I dont know how to obtain the database connection from the pool.

Martin


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



Reply via email to