Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49109
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 14 Apr 2010 22:43:37 +0000 (22:43 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 14 Apr 2010 22:43:37 +0000 (22:43 +0000)
Remove unused authenticate() method with a broken default impl

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@934232 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/Realm.java
java/org/apache/catalina/realm/CombinedRealm.java
java/org/apache/catalina/realm/LockOutRealm.java
java/org/apache/catalina/realm/RealmBase.java

index 6e5fa37..42ad402 100644 (file)
@@ -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>.
index 0207f7b..fc31e26 100644 (file)
@@ -80,40 +80,6 @@ public class CombinedRealm extends RealmBase {
 
 
     /**
-     * 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>.
index f5c7217..638c1bd 100644 (file)
@@ -115,35 +115,6 @@ public class LockOutRealm extends CombinedRealm {
 
 
     /**
-     * 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>.
index a0d3cb8..d935576 100644 (file)
@@ -323,21 +323,6 @@ public abstract class RealmBase extends LifecycleBase
 
 
     /**
-     * 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>.