directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r964354 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
Date Thu, 15 Jul 2010 09:44:13 GMT
Author: kayyagari
Date: Thu Jul 15 09:44:13 2010
New Revision: 964354

URL: http://svn.apache.org/viewvc?rev=964354&view=rev
Log:
o added checks to not use the credentialCache when password policy is enabled
  (when pwdpolicy is enabled, we need to fetch the user entry with all OP ATs to perform the
pwdpolicy state related checks)

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=964354&r1=964353&r2=964354&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
Thu Jul 15 09:44:13 2010
@@ -193,9 +193,13 @@ public class SimpleAuthenticator extends
     {
         LdapPrincipal principal = null;
 
-        synchronized ( credentialCache )
+        // use cache only if pwdpolicy is not enabled
+        if( getPwdPolicyConfig() == null )
         {
-            principal = ( LdapPrincipal ) credentialCache.get( bindContext.getDn().getNormName()
);
+            synchronized ( credentialCache )
+            {
+                principal = ( LdapPrincipal ) credentialCache.get( bindContext.getDn().getNormName()
);
+            }
         }
 
         byte[] storedPassword;
@@ -218,10 +222,13 @@ public class SimpleAuthenticator extends
             // Create the new principal before storing it in the cache
             principal = new LdapPrincipal( bindContext.getDn(), AuthenticationLevel.SIMPLE,
storedPassword );
 
-            // Now, update the local cache.
-            synchronized ( credentialCache )
+            // Now, update the local cache ONLY if pwdpolicy is not enabled.
+            if( getPwdPolicyConfig() == null )
             {
-                credentialCache.put( bindContext.getDn().getNormName(), principal );
+                synchronized ( credentialCache )
+                {
+                    credentialCache.put( bindContext.getDn().getNormName(), principal );
+                }
             }
         }
 



Mime
View raw message