cziegeler2003/07/12 11:39:49
Modified:.status.xml
src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration
HandlerConfiguration.java
src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components
DefaultAuthenticationManager.java
Authenticator.java
Added:
src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components
PipelineAuthenticator.java
Log:
The authentication framework now uses a configurable component to try to
authenticate a user.
This allows to drop in own authentication services or e.g. the servlet
authentication mechanism.
Revision ChangesPath
1.90 +5 -1 cocoon-2.1/status.xml
Index: status.xml
===
RCS file: /home/cvs/cocoon-2.1/status.xml,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- status.xml12 Jul 2003 13:30:02 - 1.89
+++ status.xml12 Jul 2003 18:39:48 - 1.90
@@ -184,6 +184,10 @@
+
+ The authentication framework now uses a configurable component to try to
authenticate a user.
+ This allows to drop in own authentication services or e.g. the servlet
authentication mechanism.
+
Made JSPs working in Resin that don't end on *.jsp.
1.2 +21 -3
cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration/HandlerConfiguration.java
Index: HandlerConfiguration.java
===
RCS file:
/home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/configuration/HandlerConfiguration.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HandlerConfiguration.java 27 Apr 2003 12:52:53 - 1.1
+++ HandlerConfiguration.java 12 Jul 2003 18:39:49 - 1.2
@@ -59,6 +59,7 @@
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.webapps.authentication.components.PipelineAuthenticator;
import org.apache.excalibur.source.SourceParameters;
import org.apache.excalibur.source.SourceResolver;
import org.xml.sax.SAXException;
@@ -83,6 +84,9 @@
/** The authentication resource */
private String authenticationResource;
+
+/** The class name of the authenticator to use */
+private String authenticatorClass;
/** The authentication resource parameters */
private SourceParameters authenticationResourceParameters;
@@ -141,9 +145,16 @@
// get load resource (required)
child = conf.getChild("authentication", false);
-if (child == null)
+if (child == null) {
throw new ConfigurationException("Handler '"+this.name+"' needs
authentication configuration");
-this.authenticationResource = child.getAttribute("uri");
+}
+this.authenticatorClass = child.getAttribute("authenticator",
PipelineAuthenticator.class.getName());
+if ( PipelineAuthenticator.class.getName().equals(authenticatorClass)) {
+this.authenticationResource = child.getAttribute("uri");
+} else {
+// the uri attribute is optional for other authenticators
+this.authenticationResource = child.getAttribute("uri", null);
+}
this.authenticationResourceParameters = SourceParameters.create(child);
// get load resource (optional)
@@ -268,5 +279,12 @@
*/
public String toString() {
return "authentication-Handler " + this.name;
+}
+
+/**
+ * Return the authenticator class
+ */
+public String getAuthenticatorClassName() {
+return this.authenticatorClass;
}
}
1.15 +53 -20
cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
Index: DefaultAuthenticationManager.java
===
RCS file:
/home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- DefaultAuthenticationManager.java 1 Jul 2003 19:26:40 - 1.14
+++ DefaultAuthenticationManager.java 12 Jul 2003 18:39:49 - 1.15
@@ -51,6 +51,7 @@
package org.apache.cocoon.webapps.authentication.components;
import java.io.IOException;
+imp