On 12/13/06, Lihn, Steve <[EMAIL PROTECTED]> wrote:
We are encountering an enterprise issue with the commenters being
anonymous. Is it possible to authenticate the commenters, say via LDAP, in order
for that person to write comments?
I know this is stretching Roller very far. Any help is appreciated.
Yes, you'll need to do a little Java coding, but it is possible to
implement your own comment authenticator. Here are the steps:
1) Implement the CommentAuthenticator interface below and in it,
check for LDAP login.
2) Put your implementation into the Roller classpath (e.g. in a jar in
WEB-INF/lib)
3) In your roller-custom.properties file override the property
'comment.authenticator.classname' and set it to your classname.
And here's the interface CommentAuthenticator.java:
package org.apache.roller.ui.rendering.util;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.roller.pojos.CommentData;
import org.apache.velocity.context.Context;
/**
* Interface for comment authentication plugin.
*/
public interface CommentAuthenticator {
/**
* Plugin should write out HTML for the form fields and other UI elements
* needed to display the comment authentication widget.
* @param request comment form request object
*/
public String getHtml(HttpServletRequest request);
/**
* Plugin should return true only if comment posting passes the
* authentication test.
* @param request comment posting request object
* @return true if authentication passed, false otherwise
*/
public boolean authenticate(HttpServletRequest request);
}