jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1418265 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/AuthenticationConfigurationImpl.java
Date Fri, 07 Dec 2012 10:38:57 GMT
Author: jukka
Date: Fri Dec  7 10:38:55 2012
New Revision: 1418265

URL: http://svn.apache.org/viewvc?rev=1418265&view=rev
Log:
OAK-497: No LoginModules configured error on Java 7

Use the default configuration fallback also when an empty JAAS configuration is present.

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/AuthenticationConfigurationImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/AuthenticationConfigurationImpl.java?rev=1418265&r1=1418264&r2=1418265&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/AuthenticationConfigurationImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authentication/AuthenticationConfigurationImpl.java
Fri Dec  7 10:38:55 2012
@@ -57,13 +57,19 @@ public class AuthenticationConfiguration
     @Override
     public LoginContextProvider getLoginContextProvider(NodeStore nodeStore, QueryIndexProvider
indexProvider) {
         String appName = options.getConfigValue(PARAM_APP_NAME, DEFAULT_APP_NAME);
-        Configuration loginConfig;
+        Configuration loginConfig = null;
         try {
             loginConfig = Configuration.getConfiguration();
+            if (loginConfig.getAppConfigurationEntry(appName) == null) {
+                log.warn("No login configuration available for " + appName
+                        + ": using default.");
+                loginConfig = null;
+            }
         } catch (SecurityException e) {
             log.warn("Failed to retrieve login configuration: using default.", e);
+        }
+        if (loginConfig == null) {
             loginConfig = new OakConfiguration(options); // TODO: define configuration structure
-            Configuration.setConfiguration(loginConfig);
         }
         return new LoginContextProviderImpl(appName, loginConfig, nodeStore, indexProvider,
securityProvider);
     }



Mime
View raw message