tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/security/file FileRealmConnector.java
Date Fri, 29 Oct 1999 06:14:42 GMT
craigmcc    99/10/28 23:14:42

  Modified:    src/share/org/apache/tomcat/security/file
                        FileRealmConnector.java
  Log:
  Implement the new byte-array version of authenticate() in terms of the
  String version for now.  This may not prove to be adequate as the security
  enforcing ServiceInterceptor is created.
  
  Revision  Changes    Path
  1.3       +25 -6     jakarta-tomcat/src/share/org/apache/tomcat/security/file/FileRealmConnector.java
  
  Index: FileRealmConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/security/file/FileRealmConnector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileRealmConnector.java	1999/10/23 22:30:17	1.2
  +++ FileRealmConnector.java	1999/10/29 06:14:41	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/security/file/FileRealmConnector.java,v
1.2 1999/10/23 22:30:17 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 1999/10/23 22:30:17 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/security/file/FileRealmConnector.java,v
1.3 1999/10/29 06:14:41 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 1999/10/29 06:14:41 $
    *
    * ====================================================================
    *
  @@ -83,7 +83,7 @@
    * XML-stored database of users and their associated roles.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 1999/10/23 22:30:17 $
  + * @version $Revision: 1.3 $ $Date: 1999/10/29 06:14:41 $
    */
   
   public final class FileRealmConnector
  @@ -123,8 +123,7 @@
        *
        * @param username Username of the Principal to look up
        * @param credentials Password or other credentials to use in
  -     *	authenticating this username (XXX: Is a String sufficient
  -     *  for all possible cases?)
  +     *	authenticating this username
        *
        * @exception IllegalStateException if called before <code>start()</code>
        *  has been called, or after <code>stop()</code> has been called
  @@ -142,6 +141,26 @@
   	    return ((Principal) user);
   	else
   	    return (null);
  +
  +    }
  +
  +
  +    /**
  +     * Returns the Principal associated with the specified username and
  +     * credentials, if there is one, or <code>null</code> otherwise.
  +     *
  +     * @param username Username of the Principal to look up
  +     * @param credentials Credentials to use in authenticating this username
  +     *
  +     * @exception IllegalStateException if called before <code>start()</code>
  +     *  has been called, or after <code>stop()</code> has been called
  +     */
  +    public Principal authenticate(String username, byte[] credentials) {
  +
  +	StringBuffer password = new StringBuffer();
  +	for (int i = 0; i < credentials.length; i++)
  +	    password.append((char) credentials[i]);
  +	return (authenticate(username, password.toString()));
   
       }
   
  
  
  

Mime
View raw message