openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r526296 - in /incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security: SecurityServiceImpl.java jaas/PropertiesLoginModule.java
Date Fri, 06 Apr 2007 21:58:47 GMT
Author: dblevins
Date: Fri Apr  6 14:58:46 2007
New Revision: 526296

URL: http://svn.apache.org/viewvc?view=rev&rev=526296
Log:
Initialize LoginModules on startup

Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/SecurityServiceImpl.java
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/jaas/PropertiesLoginModule.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/SecurityServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/SecurityServiceImpl.java?view=diff&rev=526296&r1=526295&r2=526296
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/SecurityServiceImpl.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/SecurityServiceImpl.java
Fri Apr  6 14:58:46 2007
@@ -79,6 +79,16 @@
 
         defaultSubject = createSubject(defaultUser);
         defaultContext = new SecurityContext(defaultSubject);
+
+        try {
+            // Perform a login attempt (which should fail)
+            // simply to excercise the initialize code of any
+            // LoginModules that are configured.
+            // They should have a chance to perform any special
+            // boot-time code that they may need.
+            login("","");
+        } catch (Throwable e) {
+        }
     }
 
     public void init(Properties props) throws Exception {

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/jaas/PropertiesLoginModule.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/jaas/PropertiesLoginModule.java?view=diff&rev=526296&r1=526295&r2=526296
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/jaas/PropertiesLoginModule.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/security/jaas/PropertiesLoginModule.java
Fri Apr  6 14:58:46 2007
@@ -16,29 +16,25 @@
  */
 package org.apache.openejb.core.security.jaas;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.openejb.core.security.jaas.UserPrincipal;
-import org.apache.openejb.core.security.jaas.GroupPrincipal;
 import org.apache.openejb.util.ConfUtils;
+import org.apache.openejb.util.Logger;
 
-import javax.security.auth.spi.LoginModule;
 import javax.security.auth.Subject;
-import javax.security.auth.login.LoginException;
-import javax.security.auth.login.FailedLoginException;
-import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
 import javax.security.auth.callback.UnsupportedCallbackException;
-import java.util.Properties;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Enumeration;
-import java.io.File;
+import javax.security.auth.login.FailedLoginException;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
 import java.io.IOException;
 import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
 
 /**
  * @version $Rev$ $Date$
@@ -48,7 +44,7 @@
     private final String USER_FILE = "UsersFile";
     private final String GROUP_FILE = "GroupsFile";
 
-    private static final Log log = LogFactory.getLog(PropertiesLoginModule.class);
+    private static Logger log = Logger.getInstance("OpenEJB.security", "org.apache.openejb.util.resources");
 
     private Subject subject;
     private CallbackHandler callbackHandler;
@@ -67,8 +63,8 @@
         this.callbackHandler = callbackHandler;
 
         debug = "true".equalsIgnoreCase((String) options.get("Debug"));
-        String usersFile = (String) options.get(USER_FILE)+"";
-        String groupsFile = (String) options.get(GROUP_FILE)+"";
+        String usersFile = (String) options.get(USER_FILE) + "";
+        String groupsFile = (String) options.get(GROUP_FILE) + "";
 
         usersUrl = ConfUtils.getConfResource(usersFile);
         groupsUrl = ConfUtils.getConfResource(groupsFile);



Mime
View raw message