Author: markt
Date: Wed Apr 14 22:43:37 2010
New Revision: 934232

URL: http://svn.apache.org/viewvc?rev=934232&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49109
Remove unused authenticate() method with a broken default impl

Modified:
    tomcat/trunk/java/org/apache/catalina/Realm.java
    tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java
    tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java
    tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java

Modified: tomcat/trunk/java/org/apache/catalina/Realm.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Realm.java?rev=934232&r1=934231&r2=934232&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Realm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Realm.java Wed Apr 14 22:43:37 2010
@@ -88,17 +88,6 @@ public interface Realm {
 
 
     /**
-     * Return the Principal associated with the specified username and
-     * credentials, if there is one; otherwise return <code>null</code>.
-     *
-     * @param username Username of the Principal to look up
-     * @param credentials Password or other credentials to use in
-     *  authenticating this username
-     */
-    public Principal authenticate(String username, byte[] credentials);
-
-
-    /**
      * Return the Principal associated with the specified username, which
      * matches the digest calculated using the given parameters using the
      * method described in RFC 2069; otherwise return <code>null</code>.

Modified: tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java?rev=934232&r1=934231&r2=934232&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java Wed Apr 14 
22:43:37 2010
@@ -80,40 +80,6 @@ public class CombinedRealm extends Realm
 
 
     /**
-     * Return the Principal associated with the specified username and
-     * credentials, if there is one; otherwise return <code>null</code>.
-     *
-     * @param username Username of the Principal to look up
-     * @param credentials Password or other credentials to use in
-     *  authenticating this username
-     */
-    @Override
-    public Principal authenticate(String username, byte[] credentials) {
-        Principal authenticatedUser = null;
-        
-        for (Realm realm : realms) {
-            if (log.isDebugEnabled()) {
-                log.debug(sm.getString("combinedRealm.authStart", username, 
realm.getInfo()));
-            }
-            
-            authenticatedUser = realm.authenticate(username, credentials);
-            
-            if (authenticatedUser == null) {
-                if (log.isDebugEnabled()) {
-                    log.debug(sm.getString("combinedRealm.authFail", username, 
realm.getInfo()));
-                }
-            } else {
-                if (log.isDebugEnabled()) {
-                    log.debug(sm.getString("combinedRealm.authSucess", 
username, realm.getInfo()));
-                }
-                break;
-            }
-        }
-        return authenticatedUser;
-    }
-
-
-    /**
      * Return the Principal associated with the specified username, which
      * matches the digest calculated using the given parameters using the
      * method described in RFC 2069; otherwise return <code>null</code>.

Modified: tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java?rev=934232&r1=934231&r2=934232&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/LockOutRealm.java Wed Apr 14 
22:43:37 2010
@@ -115,35 +115,6 @@ public class LockOutRealm extends Combin
 
 
     /**
-     * Return the Principal associated with the specified username and
-     * credentials, if there is one; otherwise return <code>null</code>.
-     *
-     * @param username Username of the Principal to look up
-     * @param credentials Password or other credentials to use in
-     *  authenticating this username
-     */
-    @Override
-    public Principal authenticate(String username, byte[] credentials) {
-        if (isLocked(username)) {
-            // Trying to authenticate a locked user is an automatic failure
-            registerAuthFailure(username);
-            
-            log.warn(sm.getString("lockOutRealm.authLockedUser", username));
-            return null;
-        }
-
-        Principal authenticatedUser = super.authenticate(username, 
credentials);
-        
-        if (authenticatedUser == null) {
-            registerAuthFailure(username);
-        } else {
-            registerAuthSuccess(username);
-        }
-        return authenticatedUser;
-    }
-
-
-    /**
      * Return the Principal associated with the specified username, which
      * matches the digest calculated using the given parameters using the
      * method described in RFC 2069; otherwise return <code>null</code>.

Modified: tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java?rev=934232&r1=934231&r2=934232&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/RealmBase.java Wed Apr 14 
22:43:37 2010
@@ -323,21 +323,6 @@ public abstract class RealmBase extends 
 
 
     /**
-     * Return the Principal associated with the specified username and
-     * credentials, if there is one; otherwise return <code>null</code>.
-     *
-     * @param username Username of the Principal to look up
-     * @param credentials Password or other credentials to use in
-     *  authenticating this username
-     */
-    public Principal authenticate(String username, byte[] credentials) {
-
-        return (authenticate(username, credentials.toString()));
-
-    }
-
-
-    /**
      * Return the Principal associated with the specified username, which
      * matches the digest calculated using the given parameters using the
      * method described in RFC 2069; otherwise return <code>null</code>.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to