jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r785981 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: DefaultSecurityManager.java security/authentication/AuthContextProvider.java security/simple/SimpleSecurityManager.java
Date Thu, 18 Jun 2009 09:21:50 GMT
Author: angela
Date: Thu Jun 18 09:21:49 2009
New Revision: 785981

URL: http://svn.apache.org/viewvc?rev=785981&view=rev
Log:
JCR-1977: authentication order has changed from 1.4.x to 1.5.x

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java?rev=785981&r1=785980&r2=785981&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
Thu Jun 18 09:21:49 2009
@@ -83,7 +83,7 @@
     private static final Logger log = LoggerFactory.getLogger(DefaultSecurityManager.class);
 
     /**
-     *
+     * Flag indicating if the security manager was properly initialized.
      */
     private boolean initialized;
 
@@ -171,10 +171,10 @@
 
         // build AuthContextProvider based on appName + optional LoginModuleConfig
         authContextProvider = new AuthContextProvider(config.getAppName(), loginModConf);
-        if (authContextProvider.isJAAS()) {
-            log.info("init: use JAAS login-configuration for " + config.getAppName());
-        } else if (authContextProvider.isLocal()) {
+        if (authContextProvider.isLocal()) {
             log.info("init: use Repository Login-Configuration for " + config.getAppName());
+        } else if (authContextProvider.isJAAS()) {
+            log.info("init: use JAAS login-configuration for " + config.getAppName());
         } else {
             String msg = "Neither JAAS nor RepositoryConfig contained a valid Configuriation
for " + config.getAppName();
             log.error(msg);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java?rev=785981&r1=785980&r2=785981&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
Thu Jun 18 09:21:49 2009
@@ -95,10 +95,10 @@
 
         CallbackHandler cbHandler = new CallbackHandlerImpl(credentials, session, principalProviderRegistry,
adminId, anonymousId);
 
-        if (isJAAS()) {
-            return new JAASAuthContext(appName, cbHandler, subject);
-        } else if (isLocal()) {
+        if (isLocal()) {
             return new LocalAuthContext(config, cbHandler, subject);
+        } else if (isJAAS()) {
+            return new JAASAuthContext(appName, cbHandler, subject);
         } else {
             throw new RepositoryException("No Login-Configuration");
         }
@@ -108,23 +108,23 @@
      * @return true if a application entry is available in a JAAS- {@link Configuration}
      */
     public boolean isJAAS() {
-        if (!initialized) {
+        if (!isLocal() && !initialized) {
             AppConfigurationEntry[] entries = getJAASConfig();
-            isJAAS = null != entries && entries.length > 0;
+            isJAAS = entries != null && entries.length > 0;
             initialized = true;
         }
         return isJAAS;
     }
 
     /**
-     * @return true if {@link #isJAAS()} is false and a login-module is configured
+     * @return true if a login-module is configured.
      */
     public boolean isLocal() {
-        return !(isJAAS() || config == null);
+        return config != null;
     }
 
     /**
-     * @return options configured for the LoginModules to use
+     * @return options configured for the LoginModules to use.
      */
     public Properties[] getModuleConfig() {
         Properties[] props = new Properties[0];

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java?rev=785981&r1=785980&r2=785981&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java
Thu Jun 18 09:21:49 2009
@@ -110,10 +110,10 @@
         // read the LoginModule configuration
         LoginModuleConfig loginModConf = config.getLoginModuleConfig();
         authCtxProvider = new AuthContextProvider(config.getAppName(), loginModConf);
-        if (authCtxProvider.isJAAS()) {
-            log.info("init: using JAAS LoginModule configuration for " + config.getAppName());
-        } else if (authCtxProvider.isLocal()) {
+        if (authCtxProvider.isLocal()) {
             log.info("init: using Repository LoginModule configuration for " + config.getAppName());
+        } else if (authCtxProvider.isJAAS()) {
+            log.info("init: using JAAS LoginModule configuration for " + config.getAppName());
         } else {
             String msg = "No valid LoginModule configuriation for " + config.getAppName();
             log.error(msg);



Mime
View raw message