jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r934355 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
Date Thu, 15 Apr 2010 10:23:57 GMT
Author: angela
Date: Thu Apr 15 10:23:57 2010
New Revision: 934355

URL: http://svn.apache.org/viewvc?rev=934355&view=rev
Log:
JCR-2603: DefaultLoginModule performs anonymous login in case of unsupported Credentials implementation

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

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java?rev=934355&r1=934354&r2=934355&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
Thu Apr 15 10:23:57 2010
@@ -297,13 +297,9 @@ public abstract class AbstractLoginModul
         Credentials creds = getCredentials();
         if (creds == null) {
             log.debug("No credentials available -> try default (anonymous) authentication.");
-        } else {
-            if (supportsCredentials(creds)) {
-                sharedState.put(KEY_CREDENTIALS, credentials);
-            } else {
-                log.debug("Unsupported credentials implementation : " + creds.getClass().getName());
-                return false;
-            }
+        } else if (!supportsCredentials(creds)) {
+            log.debug("Unsupported credentials implementation : " + creds.getClass().getName());
+            return false;
         }
         
         try {
@@ -551,6 +547,9 @@ public abstract class AbstractLoginModul
                 CredentialsCallback callback = new CredentialsCallback();
                 callbackHandler.handle(new Callback[]{callback});
                 credentials = callback.getCredentials();
+                if (credentials != null && supportsCredentials(credentials)) {
+                    sharedState.put(KEY_CREDENTIALS, credentials);                    
+                }
             } catch (UnsupportedCallbackException e) {
                 log.warn("Credentials-Callback not supported try Name-Callback");
             } catch (IOException e) {



Mime
View raw message