jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r770165 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
Date Thu, 30 Apr 2009 11:13:42 GMT
Author: jukka
Date: Thu Apr 30 11:13:42 2009
New Revision: 770165

URL: http://svn.apache.org/viewvc?rev=770165&view=rev
Log:
JCR-2087: Upgrade to Java 5 as the base platform

Conversion between Properties and Map<String, ?> doesn't work transparently. Create
an explicit copy to avoid compile failures.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java?rev=770165&r1=770164&r2=770165&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/LocalAuthContext.java
Thu Apr 30 11:13:42 2009
@@ -26,7 +26,11 @@
 import javax.security.auth.login.FailedLoginException;
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
+
+import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
 
 /**
  * Provide AuthContext interface, for a JAAS-LoginModule not running in
@@ -67,7 +71,17 @@
         } catch (ConfigurationException e) {
             throw new LoginException(e.getMessage());
         }
-        module.initialize(subject, cbHandler, new HashMap(), config.getParameters());
+
+        Map<String, String> state = new HashMap<String, String>();
+        Map<String, String> options = new HashMap<String, String>();
+        Properties parameters = config.getParameters();
+        Enumeration<?> names = parameters.propertyNames();
+        while (names.hasMoreElements()) {
+            String name = (String) names.nextElement();
+            options.put(name, parameters.getProperty(name));
+        }
+        module.initialize(subject, cbHandler, state, options);
+
         try {
             if (!(module.login() && module.commit())) {
                 throw new FailedLoginException("LoginModule ignored Credentials");



Mime
View raw message