/*
- * $Header: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/config/SecurityConfig.java,v 1.9 2003/07/14 11:44:31 maxcooper Exp $
- * $Revision: 1.9 $
- * $Date: 2003/07/14 11:44:31 $
+ * $Header: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/config/SecurityConfig.java,v 1.10 2003/07/14 18:53:46 maxcooper Exp $
+ * $Revision: 1.10 $
+ * $Date: 2003/07/14 18:53:46 $
*
* ====================================================================
* The SecurityFilter Software License, Version 1.1
* @author Torgeir Veimo (torgeir@pobox.com)
* @author Max Cooper (max@maxcooper.com)
* @author Daya Sharma (iamdaya@yahoo.com, billydaya@sbcglobal.net)
- * @version $Revision: 1.9 $ $Date: 2003/07/14 11:44:31 $
+ * @version $Revision: 1.10 $ $Date: 2003/07/14 18:53:46 $
*/
public class SecurityConfig {
private SecurityRealmInterface realm = null;
private Object lastRealm = null;
private boolean validating;
- private String authMethod;
+ private String authMethod;
+ private String realmName;
/**
* Constructor that takes the validating flag and debug level to be used while parsing.
this.defaultPage = defaultPage;
}
+ /**
+ * Get the authentication method being used to challenge the user.
+ * Currently, only BASIC and FORM based are supported.
+ *
+ * @return BASIC or FORM
+ */
public String getAuthMethod() {
return authMethod;
}
- /**
- * Set the authentication method being used to challenge the user. As of now only BASIC and FORM based are supported.
- *
- * @param authMethod The authentication method to be used by the filter
- */
- public void setAuthMethod(String authMethod) {
- this.authMethod = authMethod;
+ /**
+ * Set the authentication method being used to challenge the user.
+ * Currently, only BASIC and FORM based are supported.
+ *
+ * @param authMethod The authentication method to be used by the filter
+ */
+ public void setAuthMethod(String authMethod) {
+ this.authMethod = authMethod;
+ }
+
+ /**
+ * Get the authentication realm name.
+ * This is used for BASIC authentication.
+ *
+ * @return the realm-name configured by the application developer
+ */
+ public String getRealmName() {
+ return realmName;
}
/**
+ * Set the authentication realm name.
+ * This is used for BASIC authentication.
+ *
+ * @param realmName the realm name to be used for BASIC authentication
+ */
+ public void setRealmName(String realmName) {
+ this.realmName = realmName;
+ }
+
+ /**
* Return the realm to use for authentication. This is the outer-most realm if nested realms are used.
* The outer-most realm must be listed first in the configuration file.
*/
Digester digester = new Digester();
registerLocalDTDs(digester);
-
+
digester.push(this);
digester.setValidating(validating);
digester.addSetNext("securityfilter-config/realm", "addRealm", "java.lang.Object");
// login and error pages
- digester.addCallMethod("securityfilter-config/login-config/auth-method", "setAuthMethod", 0);
+ digester.addCallMethod("securityfilter-config/login-config/auth-method", "setAuthMethod", 0);
+ digester.addCallMethod("securityfilter-config/login-config/realm-name", "setRealmName", 0);
digester.addCallMethod("securityfilter-config/login-config/form-login-config/form-login-page", "setLoginPage", 0);
digester.addCallMethod("securityfilter-config/login-config/form-login-config/form-error-page", "setErrorPage", 0);
- digester.addCallMethod("securityfilter-config/login-config/form-login-config/form-default-page", "setDefaultPage", 0);
+ digester.addCallMethod(
+ "securityfilter-config/login-config/form-login-config/form-default-page",
+ "setDefaultPage",
+ 0
+ );
// security-constraint
digester.addObjectCreate(