geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r554977 [1/2] - in /geronimo/server/trunk: applications/console/geronimo-console-core/src/main/java/org/apache/geronimo/console/core/security/ applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/security...
Date Tue, 10 Jul 2007 15:33:01 GMT
Author: djencks
Date: Tue Jul 10 08:32:56 2007
New Revision: 554977

URL: http://svn.apache.org/viewvc?view=rev&rev=554977
Log:
GERONIMO-3303 Major simplification of authentication framework.  Removes remote login and supporting code

Added:
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java   (with props)
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/WrappingLoginModule.java   (with props)
Removed:
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginUtils.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/ServerRealmConfigurationEntry.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/client/ClientLoginModuleProxy.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/client/JaasLoginCoordinator.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/client/LoginModuleProxy.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/client/ServerLoginProxy.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/client/WrappingClientLoginModuleProxy.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/DecouplingCallbackHandler.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/ExpiredLoginModuleException.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginModuleConfiguration.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasLoginServiceMBean.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasSecuritySession.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/JaasSessionId.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/server/WrappingLoginModuleProxy.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/network/protocol/SubjectContext.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/InvocationSupport.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/InvocationType.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/MarshalledMethod.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/ReflexiveInterceptor.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/remoting/jmx/SerializableInvocation.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/MultipleLoginDomainTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/network/protocol/SubjectCarryingProtocolTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java
Modified:
    geronimo/server/trunk/applications/console/geronimo-console-core/src/main/java/org/apache/geronimo/console/core/security/PropertiesLoginModuleManager.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
    geronimo/server/trunk/assemblies/geronimo-framework/src/main/resources/var/config/config.xml
    geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/resources/var/config/config.xml
    geronimo/server/trunk/assemblies/geronimo-jetty6-minimal/src/main/resources/var/config/config.xml
    geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/resources/var/config/config.xml
    geronimo/server/trunk/assemblies/geronimo-tomcat6-minimal/src/main/resources/var/config/config.xml
    geronimo/server/trunk/assemblies/pom.xml
    geronimo/server/trunk/configs/client-security/src/plan/plan.xml
    geronimo/server/trunk/configs/j2ee-security/src/plan/plan.xml
    geronimo/server/trunk/configs/ldap-realm/src/plan/plan.xml
    geronimo/server/trunk/configs/pom.xml
    geronimo/server/trunk/configs/server-security-config/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/AbstractWebModuleTest.java
    geronimo/server/trunk/modules/geronimo-jmx-remoting/src/test/java/org/apache/geronimo/jmxremoting/AuthenticatorTest.java
    geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/ConfigurationEntryFactory.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/DirectConfigurationEntry.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/GeronimoLoginConfiguration.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleGBean.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleSettings.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java
    geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/SecurityRealm.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/AbstractTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/credentialstore/SimpleCredentialStoreImplTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/LoginKerberosNonGeronimoTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/LoginKerberosTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/LoginPropertiesFileTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/LoginSQLTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/NoLoginModuleReuseTest.java
    geronimo/server/trunk/modules/geronimo-security/src/test/java/org/apache/geronimo/security/jaas/TimeoutTest.java
    geronimo/server/trunk/modules/geronimo-tomcat6/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-core/src/main/java/org/apache/geronimo/console/core/security/PropertiesLoginModuleManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-core/src/main/java/org/apache/geronimo/console/core/security/PropertiesLoginModuleManager.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-core/src/main/java/org/apache/geronimo/console/core/security/PropertiesLoginModuleManager.java (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-core/src/main/java/org/apache/geronimo/console/core/security/PropertiesLoginModuleManager.java Tue Jul 10 08:32:56 2007
@@ -276,19 +276,19 @@
     }
 
     private String getUsersURI() {
-        return loginModule.getOptions().getProperty(usersKey);
+        return (String) loginModule.getOptions().get(usersKey);
     }
 
     private String getGroupsURI() {
-        return loginModule.getOptions().getProperty(groupsKey);
+        return (String) loginModule.getOptions().get(groupsKey);
     }
 
     private String getDigest() {
-        return loginModule.getOptions().getProperty(digestKey);
+        return (String) loginModule.getOptions().get(digestKey);
     }
 
     private String getEncoding() {
-        return loginModule.getOptions().getProperty(encodingKey);
+        return (String) loginModule.getOptions().get(encodingKey);
     }
 
     private void store(Properties props, URL url) throws Exception {

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java Tue Jul 10 08:32:56 2007
@@ -16,21 +16,67 @@
  */
 package org.apache.geronimo.console.securitymanager.realm;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import javax.security.auth.Subject;
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.spi.LoginModule;
+import javax.xml.namespace.QName;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.deployment.xbeans.AbstractServiceType;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.deployment.xbeans.AttributeType;
-import org.apache.geronimo.deployment.xbeans.ModuleDocument;
-import org.apache.geronimo.deployment.xbeans.ModuleType;
 import org.apache.geronimo.deployment.xbeans.DependenciesType;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
+import org.apache.geronimo.deployment.xbeans.ModuleDocument;
+import org.apache.geronimo.deployment.xbeans.ModuleType;
 import org.apache.geronimo.deployment.xbeans.ReferenceType;
-import org.apache.geronimo.deployment.xbeans.XmlAttributeType;
-import org.apache.geronimo.deployment.xbeans.AbstractServiceType;
 import org.apache.geronimo.deployment.xbeans.ServiceDocument;
+import org.apache.geronimo.deployment.xbeans.XmlAttributeType;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
@@ -44,68 +90,24 @@
 import org.apache.geronimo.kernel.repository.ListableRepository;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.security.jaas.JaasLoginModuleChain;
-import org.apache.geronimo.security.jaas.LoginModuleSettings;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
+import org.apache.geronimo.security.jaas.LoginModuleSettings;
 import org.apache.geronimo.security.jaas.NamedUPCredentialLoginModule;
+import org.apache.geronimo.security.jaas.LoginModuleControlFlag;
+import org.apache.geronimo.security.jaas.LoginModuleControlFlagEditor;
+import org.apache.geronimo.security.realm.SecurityRealm;
 import org.apache.geronimo.security.realm.providers.FileAuditLoginModule;
 import org.apache.geronimo.security.realm.providers.GeronimoPasswordCredentialLoginModule;
 import org.apache.geronimo.security.realm.providers.RepeatedFailureLockoutLoginModule;
-import org.apache.geronimo.security.realm.SecurityRealm;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerControlFlagType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginConfigDocument;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginConfigType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginModuleType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerOptionType;
-import org.apache.geronimo.gbean.AbstractName;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.status.ProgressObject;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.WindowState;
-import javax.security.auth.Subject;
-import javax.security.auth.spi.LoginModule;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-import javax.xml.namespace.QName;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.SortedSet;
-
 /**
  * A portlet that lists, creates, and edits security realms.
  *
@@ -400,7 +402,6 @@
                             details.getControlFlag().equals("REQUISITE") ? GerControlFlagType.REQUISITE :
                                     details.getControlFlag().equals("SUFFICIENT") ? GerControlFlagType.SUFFICIENT :
                                             GerControlFlagType.OPTIONAL);
-            module.setServerSide(details.isServerSide());
             module.setLoginDomainName(details.getLoginDomainName());
             module.setLoginModuleClass(details.getClassName());
             module.setWrapPrincipals(details.isWrapPrincipals());
@@ -480,7 +481,6 @@
             LoginModuleSettings module = node.getLoginModule();
             details.setLoginDomainName(module.getLoginDomainName());
             details.setClassName(module.getLoginModuleClass());
-            details.setServerSide(module.isServerSide());
             details.setWrapPrincipals(module.isWrapPrincipals());
             details.setOptions(module.getOptions());
             list.add(details);
@@ -540,7 +540,6 @@
                 node.setControlFlag(details.getControlFlag());
                 LoginModuleSettings module = node.getLoginModule();
                 module.setOptions(details.getOptions());
-                module.setServerSide(details.isServerSide());
                 module.setWrapPrincipals(details.isWrapPrincipals());
                 module.setLoginModuleClass(details.getClassName());
             }
@@ -740,53 +739,48 @@
         if (data.modules == null) {
             LoginModuleDetails module = new LoginModuleDetails();
             module.setClassName(getSelectedModule(data).getClassName());
-            module.setControlFlag("REQUIRED");
+            module.setControlFlag(LoginModuleControlFlag.REQUIRED);
             module.setLoginDomainName(data.getName());
-            module.setServerSide(data.getRealmType().indexOf("erberos") < 0);
-            Properties props = module.getOptions();
+            Map<String, Object> props = module.getOptions();
             for (Iterator it = data.getOptions().entrySet().iterator(); it.hasNext();) {
                 Map.Entry entry = (Map.Entry) it.next();
-                props.setProperty((String) entry.getKey(), (String) entry.getValue());
+                props.put((String) entry.getKey(), (String) entry.getValue());
             }
             list.add(module);
             if (data.isStorePassword()) {
                 module = new LoginModuleDetails();
                 module.setClassName(GeronimoPasswordCredentialLoginModule.class.getName());
-                module.setControlFlag("OPTIONAL");
+                module.setControlFlag(LoginModuleControlFlag.OPTIONAL);
                 module.setLoginDomainName(data.getName() + "-Password");
-                module.setServerSide(true);
                 list.add(module);
             }
             if (data.getAuditPath() != null) {
                 module = new LoginModuleDetails();
                 module.setClassName(FileAuditLoginModule.class.getName());
-                module.setControlFlag("OPTIONAL");
+                module.setControlFlag(LoginModuleControlFlag.OPTIONAL);
                 module.setLoginDomainName(data.getName() + "-Audit");
-                module.setServerSide(true);
                 props = module.getOptions();
-                props.setProperty("file", data.getAuditPath());
+                props.put("file", data.getAuditPath());
                 list.add(module);
             }
             if (data.isLockoutEnabled()) {
                 module = new LoginModuleDetails();
                 module.setClassName(RepeatedFailureLockoutLoginModule.class.getName());
-                module.setControlFlag("REQUISITE");
+                module.setControlFlag(LoginModuleControlFlag.REQUISITE);
                 module.setLoginDomainName(data.getName() + "-Lockout");
-                module.setServerSide(true);
                 props = module.getOptions();
-                props.setProperty("failureCount", data.getLockoutCount());
-                props.setProperty("failurePeriodSecs", data.getLockoutWindow());
-                props.setProperty("lockoutDurationSecs", data.getLockoutDuration());
+                props.put("failureCount", data.getLockoutCount());
+                props.put("failurePeriodSecs", data.getLockoutWindow());
+                props.put("lockoutDurationSecs", data.getLockoutDuration());
                 list.add(module);
             }
             if (data.getCredentialName() != null) {
                 module = new LoginModuleDetails();
                 module.setClassName(NamedUPCredentialLoginModule.class.getName());
-                module.setControlFlag("OPTIONAL");
+                module.setControlFlag(LoginModuleControlFlag.OPTIONAL);
                 module.setLoginDomainName(data.getName() + "-NamedUPC");
-                module.setServerSide(true);
                 props = module.getOptions();
-                props.setProperty(NamedUPCredentialLoginModule.CREDENTIAL_NAME, data.getCredentialName());
+                props.put(NamedUPCredentialLoginModule.CREDENTIAL_NAME, data.getCredentialName());
                 list.add(module);
             }
         } else {
@@ -871,13 +865,10 @@
                 details.setClassName(cls);
                 String flag = request.getParameter("module-control-" + index);
                 if (flag == null || flag.equals("")) continue;
-                details.setControlFlag(flag);
+                details.setControlFlag(toFlag(flag));
                 String wrap = request.getParameter("module-wrap-" + index);
                 if (wrap == null || wrap.equals("")) continue;
                 details.setWrapPrincipals(Boolean.valueOf(wrap).booleanValue());
-                String server = request.getParameter("module-server-" + index);
-                if (server == null || server.equals("")) continue;
-                details.setServerSide(Boolean.valueOf(server).booleanValue());
                 String options = request.getParameter("module-options-" + index);
                 if (options != null && !options.equals("")) {
                     BufferedReader in = new BufferedReader(new StringReader(options));
@@ -889,7 +880,7 @@
                             }
                             int pos = line.indexOf('=');
                             if (pos > -1) {
-                                details.getOptions().setProperty(line.substring(0, pos), line.substring(pos + 1));
+                                details.getOptions().put(line.substring(0, pos), line.substring(pos + 1));
                             }
                         }
                     } catch (IOException e) {
@@ -903,6 +894,12 @@
             }
         }
 
+        private LoginModuleControlFlag toFlag(String flag) {
+            LoginModuleControlFlagEditor editor = new LoginModuleControlFlagEditor();
+            editor.setAsText(flag);
+            return (LoginModuleControlFlag) editor.getValue();
+        }
+
         public void reorderOptions(MasterLoginModuleInfo.OptionInfo[] info) {
             if (info == null || info.length == 0) {
                 return; // Probably SQL or something that handles this manually
@@ -942,9 +939,8 @@
                     if (module.getClassName() != null)
                         response.setRenderParameter("module-class-" + i, module.getClassName());
                     if (module.getControlFlag() != null)
-                        response.setRenderParameter("module-control-" + i, module.getControlFlag());
+                        response.setRenderParameter("module-control-" + i,module.getControlFlag().toString());
                     response.setRenderParameter("module-wrap-" + i, Boolean.toString(module.isWrapPrincipals()));
-                    response.setRenderParameter("module-server-" + i, Boolean.toString(module.isServerSide()));
                     if (module.getOptions().size() > 0)
                         response.setRenderParameter("module-options-" + i, module.getOptionString());
                 }
@@ -1015,10 +1011,9 @@
     public static class LoginModuleDetails implements Serializable {
         private String loginDomainName;
         private String className;
-        private String controlFlag;
-        private boolean serverSide = true;
+        private LoginModuleControlFlag controlFlag;
         private boolean wrapPrincipals = false;
-        private Properties options = new Properties();
+        private Map<String, Object> options = new HashMap<String, Object>();
 
         public String getLoginDomainName() {
             return loginDomainName;
@@ -1036,27 +1031,19 @@
             this.className = className;
         }
 
-        public String getControlFlag() {
+        public LoginModuleControlFlag getControlFlag() {
             return controlFlag;
         }
 
-        public void setControlFlag(String controlFlag) {
+        public void setControlFlag(LoginModuleControlFlag controlFlag) {
             this.controlFlag = controlFlag;
         }
 
-        public boolean isServerSide() {
-            return serverSide;
-        }
-
-        public void setServerSide(boolean serverSide) {
-            this.serverSide = serverSide;
-        }
-
-        public Properties getOptions() {
+        public Map<String, Object> getOptions() {
             return options;
         }
 
-        public void setOptions(Properties options) {
+        public void setOptions(Map<String, Object> options) {
             this.options = options;
         }
 
@@ -1072,7 +1059,7 @@
             StringBuffer buf = new StringBuffer();
             for (Iterator it = options.keySet().iterator(); it.hasNext();) {
                 String key = (String) it.next();
-                buf.append(key).append("=").append(options.getProperty(key)).append("\n");
+                buf.append(key).append("=").append(options.get(key)).append("\n");
             }
             return buf.toString();
         }

Modified: geronimo/server/trunk/assemblies/geronimo-framework/src/main/resources/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-framework/src/main/resources/var/config/config.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-framework/src/main/resources/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-framework/src/main/resources/var/config/config.xml Tue Jul 10 08:32:56 2007
@@ -39,10 +39,6 @@
     </module>
     
     <module name="org.apache.geronimo.configs/j2ee-security/${version}/car">
-        <gbean name="JaasLoginServiceRemotingServer">
-            <attribute name="host">${PlanServerHostname}</attribute>
-            <attribute name="port">${PlanRemoteLoginPort}</attribute>
-        </gbean>
         <gbean name="JMXService">
             <attribute name="protocol">rmi</attribute>
             <attribute name="host">${PlanServerHostname}</attribute>

Modified: geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/resources/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/resources/var/config/config.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/resources/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-jetty6-jee5/src/main/resources/var/config/config.xml Tue Jul 10 08:32:56 2007
@@ -45,10 +45,6 @@
     <module name="org.apache.geronimo.configs/transaction/${version}/car"/>
 
     <module name="org.apache.geronimo.configs/j2ee-security/${version}/car">
-        <gbean name="JaasLoginServiceRemotingServer">
-            <attribute name="host">${PlanServerHostname}</attribute>
-            <attribute name="port">${PlanRemoteLoginPort + portOffset}</attribute>
-        </gbean>
         <gbean name="JMXService">
             <attribute name="protocol">rmi</attribute>
             <attribute name="host">${PlanServerHostname}</attribute>

Modified: geronimo/server/trunk/assemblies/geronimo-jetty6-minimal/src/main/resources/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-jetty6-minimal/src/main/resources/var/config/config.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-jetty6-minimal/src/main/resources/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-jetty6-minimal/src/main/resources/var/config/config.xml Tue Jul 10 08:32:56 2007
@@ -43,10 +43,6 @@
     <module name="org.apache.geronimo.configs/transaction/${version}/car"/>
 
     <module name="org.apache.geronimo.configs/j2ee-security/${version}/car">
-        <gbean name="JaasLoginServiceRemotingServer">
-            <attribute name="host">${PlanServerHostname}</attribute>
-            <attribute name="port">${PlanRemoteLoginPort + portOffset}</attribute>
-        </gbean>
         <gbean name="JMXService">
             <attribute name="protocol">rmi</attribute>
             <attribute name="host">${PlanServerHostname}</attribute>

Modified: geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/resources/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/resources/var/config/config.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/resources/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-tomcat6-jee5/src/main/resources/var/config/config.xml Tue Jul 10 08:32:56 2007
@@ -45,10 +45,6 @@
     <module name="org.apache.geronimo.configs/transaction/${version}/car"/>
 
     <module name="org.apache.geronimo.configs/j2ee-security/${version}/car">
-        <gbean name="JaasLoginServiceRemotingServer">
-            <attribute name="host">${PlanServerHostname}</attribute>
-            <attribute name="port">${PlanRemoteLoginPort + portOffset}</attribute>
-        </gbean>
         <gbean name="JMXService">
             <attribute name="protocol">rmi</attribute>
             <attribute name="host">${PlanServerHostname}</attribute>

Modified: geronimo/server/trunk/assemblies/geronimo-tomcat6-minimal/src/main/resources/var/config/config.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-tomcat6-minimal/src/main/resources/var/config/config.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-tomcat6-minimal/src/main/resources/var/config/config.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-tomcat6-minimal/src/main/resources/var/config/config.xml Tue Jul 10 08:32:56 2007
@@ -43,10 +43,6 @@
     <module name="org.apache.geronimo.configs/transaction/${version}/car"/>
 
     <module name="org.apache.geronimo.configs/j2ee-security/${version}/car">
-        <gbean name="JaasLoginServiceRemotingServer">
-            <attribute name="host">${PlanServerHostname}</attribute>
-            <attribute name="port">${PlanRemoteLoginPort + portOffset}</attribute>
-        </gbean>
         <gbean name="JMXService">
             <attribute name="protocol">rmi</attribute>
             <attribute name="host">${PlanServerHostname}</attribute>

Modified: geronimo/server/trunk/assemblies/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/pom.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/assemblies/pom.xml (original)
+++ geronimo/server/trunk/assemblies/pom.xml Tue Jul 10 08:32:56 2007
@@ -54,7 +54,6 @@
         <PlanORBSunSSLPort>2001</PlanORBSunSSLPort>
         <PlanActiveMQPort>61616</PlanActiveMQPort>
         <PlanDerbyPort>1527</PlanDerbyPort>
-        <PlanRemoteLoginPort>4242</PlanRemoteLoginPort>
         <PlanLdapPort>1389</PlanLdapPort>
         <PlanHTTPPortPrimary>8080</PlanHTTPPortPrimary>
         <PlanHTTPSPortPrimary>8443</PlanHTTPSPortPrimary>

Modified: geronimo/server/trunk/configs/client-security/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client-security/src/plan/plan.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/configs/client-security/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/client-security/src/plan/plan.xml Tue Jul 10 08:32:56 2007
@@ -45,26 +45,6 @@
         </references>
     </gbean>
 
-    <!-- use for app client: logs into server remotely -->
-    <gbean name="ServerLoginStubDCE" class="org.apache.geronimo.security.jaas.DirectConfigurationEntry">
-        <attribute name="applicationConfigName">server-login</attribute>
-        <attribute name="controlFlag">REQUIRED</attribute>
-        <reference name="Module">
-            <name>ServerLoginCoordinator</name>
-        </reference>
-    </gbean>
-
-    <gbean name="ServerLoginCoordinator" class="org.apache.geronimo.security.jaas.LoginModuleGBean">
-        <attribute name="loginModuleClass">org.apache.geronimo.security.jaas.client.JaasLoginCoordinator</attribute>
-        <attribute name="serverSide">false</attribute>
-        <attribute name="options">
-            host=localhost
-            port=4242
-            realm=geronimo-admin
-        </attribute>
-        <attribute name="loginDomainName">geronimo-admin</attribute>
-    </gbean>
-
     <!-- useful for corba: logs into a local realm, and server must reauthenticate each call -->
     <gbean name="client-properties-realm"
         class="org.apache.geronimo.security.realm.GenericSecurityRealm">
@@ -87,18 +67,6 @@
         <reference name="ServerInfo">
             <name>ServerInfo</name>
         </reference>
-        <reference name="LoginService">
-            <name>JaasLoginService</name>
-        </reference>
-    </gbean>
-    <!-- this is really a server-side only gbean but its needed to make the client side GenericSecurityRealm work -->
-    <gbean name="JaasLoginService" class="org.apache.geronimo.security.jaas.server.JaasLoginService">
-        <reference name="Realms">
-            <name>client-properties-realm</name>
-        </reference>
-        <!--        <attribute name="reclaimPeriod">100000</attribute>-->
-        <attribute name="algorithm">HmacSHA1</attribute>
-        <attribute name="password">secret</attribute>
     </gbean>
 
     <gbean name="KeystoreManager" class="org.apache.geronimo.security.keystore.FileKeystoreManager">

Modified: geronimo/server/trunk/configs/j2ee-security/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-security/src/plan/plan.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/configs/j2ee-security/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/j2ee-security/src/plan/plan.xml Tue Jul 10 08:32:56 2007
@@ -35,27 +35,13 @@
         </references>
     </gbean>
 
-    <gbean name="JaasLoginService" class="org.apache.geronimo.security.jaas.server.JaasLoginService">
-        <reference name="Realms"></reference>
-        <!--        <attribute name="reclaimPeriod">100000</attribute>-->
-        <attribute name="algorithm">HmacSHA1</attribute>
-        <attribute name="password">secret</attribute>
-    </gbean>
-
-    <gbean name="JaasLoginServiceRemotingServer" class="org.apache.geronimo.security.remoting.jmx.JaasLoginServiceRemotingServer">
-        <attribute name="protocol">tcp</attribute>
-        <attribute name="host">${PlanServerHostname}</attribute>
-        <attribute name="port">${PlanRemoteLoginPort}</attribute>
-        <reference name="LoginService"><name>JaasLoginService</name></reference>
-    </gbean>
-
     <!-- JMX Remoting -->
     <gbean name="JMXService" class="org.apache.geronimo.jmxremoting.JMXConnector">
         <attribute name="protocol">rmi</attribute>
         <attribute name="host">${PlanServerHostname}</attribute>
         <attribute name="port">${PlanJMXPort}</attribute>
         <attribute name="urlPath">/jndi/rmi://${PlanServerHostname}:${PlanNamingPort}/JMXConnector</attribute>
-        <attribute name="applicationConfigName">JMX</attribute>
+        <attribute name="applicationConfigName">geronimo-admin</attribute>
         <reference name="MBeanServerReference">
             <name>MBeanServerReference</name>
         </reference>

Modified: geronimo/server/trunk/configs/ldap-realm/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/ldap-realm/src/plan/plan.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/configs/ldap-realm/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/ldap-realm/src/plan/plan.xml Tue Jul 10 08:32:56 2007
@@ -23,7 +23,6 @@
    <gbean name="ldap-login"
         class="org.apache.geronimo.security.jaas.LoginModuleGBean">
         <attribute name="loginModuleClass">org.apache.geronimo.security.realm.providers.LDAPLoginModule</attribute>
-        <attribute name="serverSide">true</attribute>
         <attribute name="options">
 		initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory
 		connectionURL=ldap://localhost:1389
@@ -51,10 +50,6 @@
         <reference name="ServerInfo">
             <name>ServerInfo</name>
         </reference>
-        <!-- Add -->
-        <reference name="LoginService">
-            <name>JaasLoginService</name>
-         </reference>
     </gbean>
 
     <gbean name="ldap-login" class="org.apache.geronimo.security.jaas.JaasLoginModuleUse">
@@ -62,15 +57,6 @@
         <reference name="LoginModule">
             <name>ldap-login</name>
         </reference>
-    </gbean>
-    
-     <gbean name="ldaptest"
-        class="org.apache.geronimo.security.jaas.ServerRealmConfigurationEntry">
-        <attribute name="applicationConfigName">ldaptest</attribute>
-        <attribute name="realmName">ldap-realm</attribute>
-        <reference name="LoginService">
-            <name>JaasLoginService</name>
-         </reference>
     </gbean>
 
 </module>

Modified: geronimo/server/trunk/configs/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/pom.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/configs/pom.xml (original)
+++ geronimo/server/trunk/configs/pom.xml Tue Jul 10 08:32:56 2007
@@ -59,7 +59,6 @@
         <PlanHTTPSPort>8443</PlanHTTPSPort>
         <PlanAJPPort>8019</PlanAJPPort>
         <PlanOpenEJBPort>4201</PlanOpenEJBPort>
-        <PlanRemoteLoginPort>4242</PlanRemoteLoginPort>
         <PlanNamingPort>1099</PlanNamingPort>
         <PlanActiveMQPort>61616</PlanActiveMQPort>
         <PlanCOSNamingHost>localhost</PlanCOSNamingHost>

Modified: geronimo/server/trunk/configs/server-security-config/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/server-security-config/src/plan/plan.xml?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/configs/server-security-config/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/server-security-config/src/plan/plan.xml Tue Jul 10 08:32:56 2007
@@ -48,7 +48,6 @@
     <gbean name="properties-login"
         class="org.apache.geronimo.security.jaas.LoginModuleGBean">
         <attribute name="loginModuleClass">org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule</attribute>
-        <attribute name="serverSide">true</attribute>
         <attribute name="options">
             usersURI=var/security/users.properties
             groupsURI=var/security/groups.properties
@@ -63,7 +62,6 @@
             <name>properties-login</name>
         </reference>
         <reference name="ServerInfo"><name>ServerInfo</name></reference>
-        <reference name="LoginService"><name>JaasLoginService</name></reference>
     </gbean>
 
     <gbean name="properties-login" class="org.apache.geronimo.security.jaas.JaasLoginModuleUse">
@@ -72,12 +70,6 @@
              <name>properties-login</name>
          </reference>
      </gbean>
-
-    <gbean name="JMX" class="org.apache.geronimo.security.jaas.ServerRealmConfigurationEntry">
-        <attribute name="applicationConfigName">JMX</attribute>
-        <attribute name="realmName">geronimo-admin</attribute>
-        <reference name="LoginService"><name>JaasLoginService</name></reference>
-    </gbean>
 
     <gbean name="geronimo-default" class="org.apache.geronimo.security.keystore.FileKeystoreInstance">
         <attribute name="keystoreName">geronimo-default</attribute>

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapper.java Tue Jul 10 08:32:56 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.connector.outbound.security;
 
-import java.util.Properties;
+import java.util.Map;
 
 import javax.resource.spi.ManagedConnectionFactory;
 
@@ -29,8 +29,8 @@
 public class PasswordCredentialLoginModuleWrapper extends LoginModuleGBean {
     public static final String MANAGED_CONNECTION_FACTORY_OPTION = "geronimo.managedconnectionfactory.option";
 
-    public PasswordCredentialLoginModuleWrapper(String loginModuleClass, String objectName, boolean serverSide, boolean wrapPrincipals, Properties options, String loginDomainName, ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper, ClassLoader classLoader) {
-        super(loginModuleClass, objectName, serverSide, wrapPrincipals, options, loginDomainName, classLoader);
+    public PasswordCredentialLoginModuleWrapper(String loginModuleClass, String objectName, boolean wrapPrincipals, Map<String, Object> options, String loginDomainName, ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper, ClassLoader classLoader) {
+        super(loginModuleClass, objectName, wrapPrincipals, options, loginDomainName, classLoader);
         ManagedConnectionFactory managedConnectionFactory = managedConnectionFactoryWrapper.$getManagedConnectionFactory();
         getOptions().put(MANAGED_CONNECTION_FACTORY_OPTION, managedConnectionFactory);
     }

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/security/PasswordCredentialLoginModuleWrapperGBean.java Tue Jul 10 08:32:56 2007
@@ -33,7 +33,7 @@
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(PasswordCredentialLoginModuleWrapper.class, LoginModuleGBean.GBEAN_INFO, NameFactory.LOGIN_MODULE);
 
         infoBuilder.addReference("ManagedConnectionFactoryWrapper", ManagedConnectionFactoryWrapper.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
-        infoBuilder.setConstructor(new String[] {"loginModuleClass", "objectName", "serverSide", "wrapPrincipals", "options", "loginDomainName", "ManagedConnectionFactoryWrapper", "classLoader"});
+        infoBuilder.setConstructor(new String[] {"loginModuleClass", "objectName", "wrapPrincipals", "options", "loginDomainName", "ManagedConnectionFactoryWrapper", "classLoader"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/AbstractWebModuleTest.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/AbstractWebModuleTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/AbstractWebModuleTest.java Tue Jul 10 08:32:56 2007
@@ -22,7 +22,6 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 
 import javax.transaction.TransactionManager;
@@ -33,10 +32,11 @@
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.deploy.PrincipalInfo;
 import org.apache.geronimo.security.deploy.SubjectInfo;
+import org.apache.geronimo.security.jaas.ConfigurationEntryFactory;
 import org.apache.geronimo.security.jaas.GeronimoLoginConfiguration;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
+import org.apache.geronimo.security.jaas.LoginModuleControlFlag;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
-import org.apache.geronimo.security.jaas.server.JaasLoginService;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.ApplicationPrincipalRoleConfigurationManager;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
@@ -155,25 +155,20 @@
 
         new SecurityServiceImpl(cl, serverInfo, "org.apache.geronimo.security.jacc.GeronimoPolicyConfigurationFactory", "org.apache.geronimo.security.jacc.GeronimoPolicy", null, null, null, null);
 
-        Properties options = new Properties();
-        options.setProperty("usersURI", new File(BASEDIR, "src/test/resources/data/users.properties").toURI().toString());
-        options.setProperty("groupsURI", new File(BASEDIR, "src/test/resources/data/groups.properties").toURI().toString());
+        Map<String, Object> options = new HashMap<String, Object>();
+        options.put("usersURI", new File(BASEDIR, "src/test/resources/data/users.properties").toURI().toString());
+        options.put("groupsURI", new File(BASEDIR, "src/test/resources/data/groups.properties").toURI().toString());
 
-        LoginModuleGBean loginModule = new LoginModuleGBean("org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule", null, true, true, options, domainName, cl);
+        LoginModuleGBean loginModule = new LoginModuleGBean("org.apache.geronimo.security.realm.providers.PropertiesFileLoginModule", null, true, options, domainName, cl);
 
-        JaasLoginModuleUse loginModuleUse = new JaasLoginModuleUse(loginModule, null, "REQUIRED", null);
-
-        JaasLoginService loginService = new JaasLoginService("HmacSHA1", "secret", cl, null);
+        JaasLoginModuleUse loginModuleUse = new JaasLoginModuleUse(loginModule, null, LoginModuleControlFlag.REQUIRED);
 
         PrincipalInfo.PrincipalEditor principalEditor = new PrincipalInfo.PrincipalEditor();
         principalEditor.setAsText("metro,org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
-        GenericSecurityRealm realm = new GenericSecurityRealm(domainName, loginModuleUse, true, true, serverInfo,  cl, null, loginService);
-
-        loginService.setRealms(Collections.singleton(realm));
-        loginService.doStart();
+        GenericSecurityRealm realm = new GenericSecurityRealm(domainName, loginModuleUse, true, serverInfo,  cl, null);
 
         GeronimoLoginConfiguration loginConfiguration = new GeronimoLoginConfiguration();
-        loginConfiguration.setConfigurations(Collections.singleton(realm));
+        loginConfiguration.setConfigurations(Collections.<ConfigurationEntryFactory>singleton(realm));
         loginConfiguration.doStart();
 
     }
@@ -191,7 +186,6 @@
         connector = new HTTPSocketConnector(container, null);
         connector.setPort(5678);
         connector.setMaxThreads(50);
-//        connector.setMinThreads(10);
         connector.doStart();
 
         TransactionManagerImpl transactionManager = new TransactionManagerImpl();

Modified: geronimo/server/trunk/modules/geronimo-jmx-remoting/src/test/java/org/apache/geronimo/jmxremoting/AuthenticatorTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jmx-remoting/src/test/java/org/apache/geronimo/jmxremoting/AuthenticatorTest.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jmx-remoting/src/test/java/org/apache/geronimo/jmxremoting/AuthenticatorTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-jmx-remoting/src/test/java/org/apache/geronimo/jmxremoting/AuthenticatorTest.java Tue Jul 10 08:32:56 2007
@@ -41,7 +41,6 @@
 public class AuthenticatorTest extends TestCase {
     private static final String CONFIG_NAME = "testConfig";
     private Configuration oldConfiguration;
-    private Configuration loginConfig;
     private String[] credentials;
     private Authenticator authenticator;
 
@@ -63,7 +62,7 @@
         } catch (SecurityException e) {
             oldConfiguration = null;
         }
-        loginConfig = new MockConfiguration();
+        Configuration loginConfig = new MockConfiguration();
         Configuration.setConfiguration(loginConfig);
 
         credentials = new String[]{"username", "password"};
@@ -77,10 +76,10 @@
 
     private class MockConfiguration extends Configuration {
         public AppConfigurationEntry[] getAppConfigurationEntry(String applicationName) {
-            if (CONFIG_NAME.equals(applicationName) == false) {
+            if (!CONFIG_NAME.equals(applicationName)) {
                 fail();
             }
-            Map map = new HashMap();
+            Map<String, Object> map = new HashMap<String, Object>();
             map.put("username", "password");
             AppConfigurationEntry entry = new AppConfigurationEntry(MockModule.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, map);
             return new AppConfigurationEntry[] {entry};

Modified: geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java Tue Jul 10 08:32:56 2007
@@ -18,19 +18,17 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Properties;
-import java.util.Set;
 import java.util.Map;
-import java.util.HashMap;
+import java.util.Set;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.service.SingleGBeanBuilder;
-import org.apache.geronimo.deployment.service.XmlReferenceBuilder;
 import org.apache.geronimo.deployment.service.XmlAttributeBuilder;
+import org.apache.geronimo.deployment.service.XmlReferenceBuilder;
 import org.apache.geronimo.deployment.xbeans.PatternType;
 import org.apache.geronimo.deployment.xbeans.XmlAttributeType;
 import org.apache.geronimo.gbean.AbstractName;
@@ -39,20 +37,22 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GReferenceInfo;
-import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.gbean.ReferenceMap;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
-import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
+import org.apache.geronimo.security.jaas.LoginModuleControlFlag;
+import org.apache.geronimo.security.jaas.LoginModuleControlFlagEditor;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerAbstractLoginModuleType;
+import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginConfigDocument;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginConfigType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginModuleRefType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginModuleType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerOptionType;
-import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginConfigDocument;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
@@ -100,8 +100,8 @@
             throw new DeploymentException("Invalid login configuration:\n" + errors + "\nDescriptor: " + loginConfig.toString());
         }
         XmlCursor xmlCursor = loginConfig.newCursor();
-        List uses = new ArrayList();
-        Set loginModuleNames = new HashSet();
+        List<GBeanData> uses = new ArrayList<GBeanData>();
+        Set<String> loginModuleNames = new HashSet<String>();
         try {
             boolean atStart = true;
             while ((atStart && xmlCursor.toFirstChild()) || (!atStart && xmlCursor.toNextSibling())) {
@@ -148,19 +148,16 @@
                         throw new DeploymentException("Security realm contains two login domains called '" + name + "'");
                     }
                     String className = trim(loginModule.getLoginModuleClass());
-                    boolean serverSide = loginModule.getServerSide();
-                    Properties options = new Properties();
+                    Map<String, Object> options = new HashMap<String, Object>();
                     GerOptionType[] optionArray = loginModule.getOptionArray();
-                    for (int j = 0; j < optionArray.length; j++) {
-                        GerOptionType gerOptionType = optionArray[j];
+                    for (GerOptionType gerOptionType : optionArray) {
                         String key = gerOptionType.getName();
                         String value = trim(gerOptionType.getStringValue());
-                        options.setProperty(key, value);
+                        options.put(key, value);
                     }
                     XmlAttributeType[] xmlOptionArray = loginModule.getXmlOptionArray();
                     if (xmlOptionArray != null) {
-                        for (int i = 0; i < xmlOptionArray.length; i++) {
-                            XmlAttributeType xmlOptionType = xmlOptionArray[i];
+                        for (XmlAttributeType xmlOptionType : xmlOptionArray) {
                             String key = xmlOptionType.getName().trim();
                             XmlObject[] anys = xmlOptionType.selectChildren(XmlAttributeType.type.qnameSetForWildcardElements());
                             if (anys.length != 1) {
@@ -181,8 +178,7 @@
                     loginModuleGBeanData.setAttribute("loginDomainName", name);
                     loginModuleGBeanData.setAttribute("loginModuleClass", className);
                     loginModuleGBeanData.setAttribute("options", options);
-                    loginModuleGBeanData.setAttribute("serverSide", Boolean.valueOf(serverSide));
-                    loginModuleGBeanData.setAttribute("wrapPrincipals", Boolean.valueOf(wrapPrincipals));
+                    loginModuleGBeanData.setAttribute("wrapPrincipals", wrapPrincipals);
 
                     context.addGBean(loginModuleGBeanData);
                 } else {
@@ -191,14 +187,14 @@
                 AbstractName thisName;
                 thisName = naming.createChildName(parentName, name, "LoginModuleUse");
                 GBeanData loginModuleUseGBeanData = new GBeanData(thisName, JaasLoginModuleUse.GBEAN_INFO);
-                loginModuleUseGBeanData.setAttribute("controlFlag", controlFlag);
+                loginModuleUseGBeanData.setAttribute("controlFlag", getControlFlag(controlFlag));
                 loginModuleUseGBeanData.setReferencePatterns("LoginModule", loginModuleReferencePatterns);
                 uses.add(loginModuleUseGBeanData);
             }
             for (int i = uses.size() - 1; i >= 0; i--) {
-                GBeanData data = (GBeanData) uses.get(i);
+                GBeanData data = uses.get(i);
                 if (i > 0) {
-                    ((GBeanData) uses.get(i - 1)).setReferencePattern("Next", data.getAbstractName());
+                    uses.get(i - 1).setReferencePattern("Next", data.getAbstractName());
                 }
                 context.addGBean(data);
             }
@@ -208,7 +204,13 @@
         } finally {
             xmlCursor.dispose();
         }
-        return uses.size() == 0 ? null : new ReferencePatterns(((GBeanData) uses.get(0)).getAbstractName());
+        return uses.size() == 0 ? null : new ReferencePatterns(uses.get(0).getAbstractName());
+    }
+
+    private LoginModuleControlFlag getControlFlag(String controlFlag) {
+        LoginModuleControlFlagEditor editor = new LoginModuleControlFlagEditor();
+        editor.setAsText(controlFlag);
+        return (LoginModuleControlFlag) editor.getValue();
     }
 
     private String trim(String string) {
@@ -227,10 +229,9 @@
         infoBuilder.addInterface(XmlReferenceBuilder.class);
         GBEAN_INFO = infoBuilder.getBeanInfo();
 
-        Set referenceInfos = JaasLoginModuleUse.GBEAN_INFO.getReferences();
+        Set<GReferenceInfo> referenceInfos = JaasLoginModuleUse.GBEAN_INFO.getReferences();
         GReferenceInfo found = null;
-        for (Iterator iterator = referenceInfos.iterator(); iterator.hasNext();) {
-            GReferenceInfo testReferenceInfo = (GReferenceInfo) iterator.next();
+        for (GReferenceInfo testReferenceInfo : referenceInfos) {
             String testRefName = testReferenceInfo.getName();
             if (testRefName.equals("LoginModule")) {
                 found = testReferenceInfo;

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/ConfigurationEntryFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/ConfigurationEntryFactory.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/ConfigurationEntryFactory.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/ConfigurationEntryFactory.java Tue Jul 10 08:32:56 2007
@@ -16,33 +16,32 @@
  */
 package org.apache.geronimo.security.jaas;
 
-import org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration;
+import javax.security.auth.login.AppConfigurationEntry;
 
 
 /**
  * A factory interface used by <code>GeronimoLoginConfiguration</code> to obtain
- * <code>JaasLoginModuleConfiguration</code>s from GBean configuration entries.
+ * <code>AppConfigurationEntry[]</code>s from GBean configuration entries.
  *
  * @version $Rev$ $Date$
  * @see GeronimoLoginConfiguration
  * @see DirectConfigurationEntry
- * @see ServerRealmConfigurationEntry
  */
 public interface ConfigurationEntryFactory {
 
     /**
      * Used to obtain the configuration name to be associated with the generated
-     * <code>JaasLoginModuleConfiguration</code>.
+     * <code>AppConfigurationEntry</code> array.
      *
      * @return the configuration name
      */
     public String getConfigurationName();
 
     /**
-     * Generate a <code>JaasLoginModuleConfiguration</code>
+     * Generate the <code>AppConfigurationEntry</code> array for the login modules in this configuration.
      *
-     * @return a <code>JaasLoginModuleConfiguration</code>
+     * @return a <code>AppConfigurationEntry[]</code>
      */
-    public JaasLoginModuleConfiguration generateConfiguration();
+    AppConfigurationEntry[] getAppConfigurationEntries();
 
 }

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/DirectConfigurationEntry.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/DirectConfigurationEntry.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/DirectConfigurationEntry.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/DirectConfigurationEntry.java Tue Jul 10 08:32:56 2007
@@ -16,10 +16,11 @@
  */
 package org.apache.geronimo.security.jaas;
 
+import javax.security.auth.login.AppConfigurationEntry;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration;
 
 
 /**
@@ -51,8 +52,8 @@
         return applicationConfigName;
     }
 
-    public JaasLoginModuleConfiguration generateConfiguration() {
-        return new JaasLoginModuleConfiguration(module.getLoginModuleClass(), controlFlag, module.getOptions(), module.isServerSide(), applicationConfigName, false, module.getClassLoader());
+    public AppConfigurationEntry[] getAppConfigurationEntries() {
+        return new AppConfigurationEntry[] {new AppConfigurationEntry(module.getLoginModuleClass(), controlFlag.getFlag(), module.getOptions())};
     }
 
     public static final GBeanInfo GBEAN_INFO;

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/GeronimoLoginConfiguration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/GeronimoLoginConfiguration.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/GeronimoLoginConfiguration.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/GeronimoLoginConfiguration.java Tue Jul 10 08:32:56 2007
@@ -20,8 +20,8 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.Map;
+
 import javax.security.auth.login.AppConfigurationEntry;
 import javax.security.auth.login.Configuration;
 
@@ -34,7 +34,6 @@
 import org.apache.geronimo.gbean.ReferenceCollectionEvent;
 import org.apache.geronimo.gbean.ReferenceCollectionListener;
 import org.apache.geronimo.security.SecurityServiceImpl;
-import org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration;
 
 
 /**
@@ -49,9 +48,9 @@
 public class GeronimoLoginConfiguration extends Configuration implements GBeanLifecycle, ReferenceCollectionListener {
 
     private final Log log = LogFactory.getLog(GeronimoLoginConfiguration.class);
-    private static Map entries = new Hashtable();
+    private static Map<String, AppConfigurationEntry[]> entries = new Hashtable<String, AppConfigurationEntry[]>();
     private Configuration oldConfiguration;
-    private Collection configurations = Collections.EMPTY_SET;
+    private Collection<ConfigurationEntryFactory> configurations = Collections.emptySet();
 
 
     public Collection getConfigurations() {
@@ -61,7 +60,7 @@
         return configurations;
     }
 
-    public void setConfigurations(Collection configurations) {
+    public void setConfigurations(Collection<ConfigurationEntryFactory> configurations) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) sm.checkPermission(SecurityServiceImpl.CONFIGURE);
 
@@ -72,17 +71,13 @@
 
         this.configurations = configurations;
 
-        for (Iterator iter = configurations.iterator(); iter.hasNext();) {
-            addConfiguration((ConfigurationEntryFactory) iter.next());
+        for (ConfigurationEntryFactory configuration : configurations) {
+            addConfiguration(configuration);
         }
     }
 
     public AppConfigurationEntry[] getAppConfigurationEntry(String name) {
-        AppConfigurationEntry entry = (AppConfigurationEntry) entries.get(name);
-
-        if (entry == null) return null;
-
-        return new AppConfigurationEntry[]{entry};
+        return entries.get(name);
     }
 
     public void refresh() {
@@ -106,16 +101,11 @@
         log.debug("Removed Application Configuration Entry " + factory.getConfigurationName());
     }
 
-    private final void addConfiguration(ConfigurationEntryFactory factory) {
-        JaasLoginModuleConfiguration config = factory.generateConfiguration();
-        if(config.getLoginDomainName() == null) {
-            throw new IllegalArgumentException("A login module to be registered standalone must have a domain name!");
-        }
+    private void addConfiguration(ConfigurationEntryFactory factory) {
         if (entries.containsKey(factory.getConfigurationName())) {
             throw new java.lang.IllegalArgumentException("ConfigurationEntry already registered");
         }
-        AppConfigurationEntry ace = new AppConfigurationEntry(config.getLoginModuleClassName(), config.getFlag().getFlag(), config.getOptions());
-
+        AppConfigurationEntry[] ace = factory.getAppConfigurationEntries();
         entries.put(factory.getConfigurationName(), ace);
         log.debug("Added Application Configuration Entry " + factory.getConfigurationName());
     }
@@ -133,8 +123,8 @@
     public void doStop() throws Exception {
         Configuration.setConfiguration(oldConfiguration);
 
-        for (Iterator iter = entries.keySet().iterator(); iter.hasNext();){
-            log.debug("Removed Application Configuration Entry " + iter.next());
+        for (String s : entries.keySet()) {
+            log.debug("Removed Application Configuration Entry " + s);
         }
         entries.clear();
 

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java Tue Jul 10 08:32:56 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.security.jaas;
 
+import javax.security.auth.login.AppConfigurationEntry;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -39,12 +41,12 @@
      * The String form of the control flag for the login module at this
      * position in the chain.
      */
-    public String getControlFlag();
+    public LoginModuleControlFlag getControlFlag();
 
     /**
      * The String form of the control flag for the login module at this
      * position in the chain.
      */
-    public void setControlFlag(String controlFlag);
+    public void setControlFlag(LoginModuleControlFlag controlFlag);
 
 }

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java Tue Jul 10 08:32:56 2007
@@ -21,12 +21,13 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.security.auth.login.AppConfigurationEntry;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration;
 
 
 /**
@@ -44,23 +45,18 @@
     private final LoginModuleSettings loginModule;
     private final JaasLoginModuleUse next;
     private LoginModuleControlFlag controlFlag;
-    private final Kernel kernel;
 
     //for reference.
     public JaasLoginModuleUse() {
         loginModule = null;
         next = null;
         controlFlag = null;
-        kernel = null;
     }
 
-    public JaasLoginModuleUse(LoginModuleSettings loginModule, JaasLoginModuleUse next, String controlFlag, Kernel kernel) {
+    public JaasLoginModuleUse(LoginModuleSettings loginModule, JaasLoginModuleUse next, LoginModuleControlFlag controlFlag) {
         this.loginModule = loginModule;
         this.next = next;
-        LoginModuleControlFlagEditor editor = new LoginModuleControlFlagEditor();
-        editor.setAsText(controlFlag);
-        this.controlFlag = (LoginModuleControlFlag) editor.getValue();
-        this.kernel = kernel;
+        this.controlFlag = controlFlag;
     }
 
     public LoginModuleSettings getLoginModule() {
@@ -71,37 +67,21 @@
         return next;
     }
 
-    public String getLoginModuleName() {
-        //TODO configId which is correct?
-//        return kernel.getAbstractNameFor(loginModule).getObjectName().getCanonicalName();
-        return kernel.getAbstractNameFor(loginModule).toURI().toString();
-    }
-
-    public String getNextName() {
-        if(next == null) {
-            return null;
-        }
-        //TODO configId which is correct?
-//        return kernel.getAbstractNameFor(next).getObjectName().getCanonicalName();
-        return kernel.getAbstractNameFor(next).toURI().toString();
-    }
-
-    public String getControlFlag() {
-        return controlFlag.toString();
+    public LoginModuleControlFlag getControlFlag() {
+        return controlFlag;
     }
 
-    public void setControlFlag(String controlFlag) {
-        LoginModuleControlFlagEditor ed = new LoginModuleControlFlagEditor();
-        ed.setAsText(controlFlag);
-        this.controlFlag = (LoginModuleControlFlag) ed.getValue();
+    public void setControlFlag(LoginModuleControlFlag controlFlag) {
+        this.controlFlag = controlFlag;
     }
 
-    public void configure(Set domainNames, List loginModuleConfigurations, Kernel kernel, ServerInfo serverInfo, ClassLoader classLoader) {
-        Map options = loginModule.getOptions();
-        if (options != null) {
-            options = new HashMap(options);
+    public void configure(Set<String> domainNames, List<AppConfigurationEntry> loginModuleConfigurations, String realmName, Kernel kernel, ServerInfo serverInfo, ClassLoader classLoader) throws ClassNotFoundException {
+        Map<String, ?> suppliedOptions = loginModule.getOptions();
+        Map<String, Object> options;
+        if (suppliedOptions != null) {
+            options = new HashMap<String, Object>(suppliedOptions);
         } else {
-            options = new HashMap();
+            options = new HashMap<String, Object>();
         }
         if (kernel != null && !options.containsKey(KERNEL_NAME_LM_OPTION)) {
             options.put(KERNEL_NAME_LM_OPTION, kernel.getKernelName());
@@ -109,9 +89,20 @@
         if (serverInfo != null && !options.containsKey(SERVERINFO_LM_OPTION)) {
             options.put(SERVERINFO_LM_OPTION, serverInfo);
         }
-        if (classLoader != null && !options.containsKey(CLASSLOADER_LM_OPTION)) {
+        if (!options.containsKey(CLASSLOADER_LM_OPTION)) {
             options.put(CLASSLOADER_LM_OPTION, classLoader);
         }
+        AppConfigurationEntry entry;
+        if (loginModule.isWrapPrincipals()) {
+            Class loginModuleClass;
+            loginModuleClass = classLoader.loadClass(loginModule.getLoginModuleClass());
+            options.put(WrappingLoginModule.CLASS_OPTION, loginModuleClass);
+            options.put(WrappingLoginModule.DOMAIN_OPTION, loginModule.getLoginDomainName());
+            options.put(WrappingLoginModule.REALM_OPTION, realmName);
+            entry = new AppConfigurationEntry(WrappingLoginModule.class.getName(), controlFlag.getFlag(), options);
+        } else {
+            entry = new AppConfigurationEntry(loginModule.getLoginModuleClass(), controlFlag.getFlag(), options);
+        }
         if (loginModule.getLoginDomainName() != null) {
             if (domainNames.contains(loginModule.getLoginDomainName())) {
                 throw new IllegalStateException("Error in realm: one security realm cannot contain multiple login modules for the same login domain");
@@ -119,11 +110,10 @@
                 domainNames.add(loginModule.getLoginDomainName());
             }
         }
-        JaasLoginModuleConfiguration config = new JaasLoginModuleConfiguration(loginModule.getLoginModuleClass(), controlFlag, options, loginModule.isServerSide(), loginModule.getLoginDomainName(), loginModule.isWrapPrincipals(), loginModule.getClassLoader());
-        loginModuleConfigurations.add(config);
+        loginModuleConfigurations.add(entry);
 
         if (next != null) {
-            next.configure(domainNames, loginModuleConfigurations, kernel, serverInfo, classLoader);
+            next.configure(domainNames, loginModuleConfigurations, realmName, kernel, serverInfo, classLoader);
         }
     }
 
@@ -131,14 +121,12 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(JaasLoginModuleUse.class, "LoginModuleUse");
-        infoBuilder.addAttribute("controlFlag", String.class, true);
-        infoBuilder.addAttribute("kernel", Kernel.class, false, false);
+        infoBuilder.addAttribute("controlFlag", LoginModuleControlFlag.class, true);
         infoBuilder.addReference("LoginModule", LoginModuleSettings.class, NameFactory.LOGIN_MODULE);
         infoBuilder.addReference("Next", JaasLoginModuleUse.class);
 
-        infoBuilder.addOperation("configure", new Class[]{Set.class, List.class, Kernel.class, ServerInfo.class, ClassLoader.class});
         infoBuilder.addInterface(JaasLoginModuleChain.class);
-        infoBuilder.setConstructor(new String[]{"LoginModule", "Next", "controlFlag", "kernel"});
+        infoBuilder.setConstructor(new String[]{"LoginModule", "Next", "controlFlag"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleGBean.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleGBean.java Tue Jul 10 08:32:56 2007
@@ -16,7 +16,8 @@
  */
 package org.apache.geronimo.security.jaas;
 
-import java.util.Properties;
+import java.util.Collections;
+import java.util.Map;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -35,18 +36,16 @@
 public class LoginModuleGBean implements LoginModuleSettings {
     private String loginDomainName;
     private String loginModuleClass;
-    private Properties options;
+    private Map<String, Object> options;
     private final String objectName;
-    private boolean serverSide;
     private boolean wrapPrincipals;
     private final ClassLoader classLoader;
 
-    public LoginModuleGBean(String loginModuleClass, String objectName, boolean serverSide, boolean wrapPrincipals, Properties options, String loginDomainName, ClassLoader classLoader) {
+    public LoginModuleGBean(String loginModuleClass, String objectName, boolean wrapPrincipals, Map<String, Object> options, String loginDomainName, ClassLoader classLoader) {
         this.loginModuleClass = loginModuleClass;
         this.objectName = objectName;
-        this.serverSide = serverSide;
         this.wrapPrincipals = wrapPrincipals;
-        this.options = options == null? new Properties(): options;
+        this.options = options == null? Collections.<String, Object>emptyMap(): options;
         this.loginDomainName = loginDomainName;
         this.classLoader = classLoader;
     }
@@ -59,11 +58,11 @@
         this.loginDomainName = loginDomainName;
     }
 
-    public Properties getOptions() {
+    public Map<String, Object> getOptions() {
         return options;
     }
 
-    public void setOptions(Properties options) {
+    public void setOptions(Map<String, Object> options) {
         this.options = options;
     }
 
@@ -79,14 +78,6 @@
         return objectName;
     }
 
-    public boolean isServerSide() {
-        return serverSide;
-    }
-
-    public void setServerSide(boolean serverSide) {
-        this.serverSide = serverSide;
-    }
-
     public boolean isWrapPrincipals() {
         return wrapPrincipals;
     }
@@ -104,9 +95,9 @@
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(LoginModuleGBean.class, NameFactory.LOGIN_MODULE);
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);
-        infoFactory.addInterface(LoginModuleSettings.class, new String[] {"options", "loginModuleClass", "serverSide", "loginDomainName", "wrapPrincipals"},
-        		                 new String[] {"options", "loginModuleClass", "serverSide", "wrapPrincipals"} );
-        infoFactory.setConstructor(new String[]{"loginModuleClass", "objectName", "serverSide", "wrapPrincipals", "options", "loginDomainName", "classLoader"});
+        infoFactory.addInterface(LoginModuleSettings.class, new String[] {"options", "loginModuleClass", "loginDomainName", "wrapPrincipals"},
+        		                 new String[] {"options", "loginModuleClass", "wrapPrincipals"} );
+        infoFactory.setConstructor(new String[]{"loginModuleClass", "objectName", "wrapPrincipals", "options", "loginDomainName", "classLoader"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleSettings.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleSettings.java?view=diff&rev=554977&r1=554976&r2=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleSettings.java (original)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/LoginModuleSettings.java Tue Jul 10 08:32:56 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.geronimo.security.jaas;
 
-import java.util.Properties;
+import java.util.Map;
 
 /**
  * @version $Rev$ $Date$
@@ -26,17 +26,13 @@
 
     void setLoginDomainName(String loginDomainName);
 
-    Properties getOptions();
+    Map<String, Object> getOptions();
 
-    void setOptions(Properties options);
+    void setOptions(Map<String, Object> options);
 
     String getLoginModuleClass();
 
     void setLoginModuleClass(String loginModuleClass);
-
-    boolean isServerSide();
-
-    void setServerSide(boolean serverSide);
 
     boolean isWrapPrincipals();
 

Added: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java?view=auto&rev=554977
==============================================================================
--- geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java (added)
+++ geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java Tue Jul 10 08:32:56 2007
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.security.jaas;
+
+import java.util.Map;
+
+import javax.security.auth.spi.LoginModule;
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.callback.CallbackHandler;
+
+import org.apache.geronimo.security.ContextManager;
+import org.apache.geronimo.security.SubjectId;
+import org.apache.geronimo.security.IdentificationPrincipal;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class SubjectRegistrationLoginModule implements LoginModule {
+
+    private Subject subject;
+
+    public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) {
+        this.subject = subject;
+    }
+
+    public boolean login() throws LoginException {
+        return true;
+    }
+
+    public boolean commit() throws LoginException {
+        SubjectId id = ContextManager.registerSubject(subject);
+        IdentificationPrincipal principal = new IdentificationPrincipal(id);
+        subject.getPrincipals().add(principal);
+        return true;
+    }
+
+    public boolean abort() throws LoginException {
+        return true;
+    }
+
+    public boolean logout() throws LoginException {
+        ContextManager.unregisterSubject(subject);
+        return true;
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/SubjectRegistrationLoginModule.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message