Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 11811 invoked from network); 2 Mar 2006 20:24:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Mar 2006 20:24:00 -0000 Received: (qmail 62416 invoked by uid 500); 2 Mar 2006 20:24:47 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 62394 invoked by uid 500); 2 Mar 2006 20:24:47 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 62383 invoked by uid 99); 2 Mar 2006 20:24:47 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2006 12:24:47 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 02 Mar 2006 12:24:46 -0800 Received: (qmail 11612 invoked by uid 65534); 2 Mar 2006 20:23:39 -0000 Message-ID: <20060302202339.11610.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r382502 - /db/derby/code/trunk/java/engine/org/apache/derby/authentication/UserAuthenticator.java Date: Thu, 02 Mar 2006 20:23:38 -0000 To: derby-commits@db.apache.org From: mikem@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mikem Date: Thu Mar 2 12:23:38 2006 New Revision: 382502 URL: http://svn.apache.org/viewcvs?rev=382502&view=rev Log: DERBY-1071 submitting on behalf of Sunitha Kambhampati. Derby passes the user in a connection request as is; to the authenticateUser method. Thus if user attribute value is delimited with quotes, the userName in authenticateUser will also be delimited. Mentioned this explicitly in the javadoc. Javadoc change only. Modified: db/derby/code/trunk/java/engine/org/apache/derby/authentication/UserAuthenticator.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/authentication/UserAuthenticator.java URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/authentication/UserAuthenticator.java?rev=382502&r1=382501&r2=382502&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/authentication/UserAuthenticator.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/authentication/UserAuthenticator.java Thu Mar 2 12:23:38 2006 @@ -38,8 +38,8 @@ * A typical example would be to implement user authentication using * LDAP, Sun NIS+, or even Windows User Domain, using this interface. *

- * Note: Additional connection attributes can be specified on the database - * connection URL and/or Properties object on jdbc connection. Values + * Note: Additional connection attributes can be specified on the + * database connection URL and/or Properties object on jdbc connection. Values * for these attributes can be retrieved at runtime by the (specialized) * authentication scheme to further help user authentication, if one needs * additional info other than user, password, and database name. @@ -52,22 +52,46 @@ /** * Authenticate a user's credentials. + *
+ * E.g. if connection url is + * jdbc:derby:testdb;create=true;user=Fred;password=p + * then the userName will be Fred + *
+ * if connection url is + * jdbc:derby:testdb;create=true;user="Fred";password=p + * then the userName will be "Fred" + *
* - * @param userName The user's name for the connection request. May be null. - * @param userPassword The user's password for the connection request. May be null. + * @param userName The user's name for the connection request. May be + * null. The user name is passed in as is from the + * connection url. For example if user attribute + * value in connection url is delimited with quotes, + * then the userName passed here will also have the + * delimiter quotes. Derby will pass in the user name + * that is set on connection url, without changing the + * casing. + * + * @param userPassword The user's password for the connection request. + * May be null. + * * @param databaseName The database that the user wants to connect to. * Will be null if this is system level authentication. - * @param info A Properties object that contains additional - * connection information, that can help to authenticate the user. It - * has properties of the 'info' object passed as part of - * DriverManager.getConnection() call and any - * attributes set on the JDBC URL. - - @return false if the connection request should be denied, true if the connection request should proceed. - If false is returned the connection attempt will receive a SQLException with SQL State 08004. + * + * @param info A Properties object that contains additional + * connection information, that can help to + * authenticate the user. It has properties of the + * 'info' object passed as part of + * DriverManager.getConnection() call and any + * attributes set on the JDBC URL. + * + * @return false if the connection request should be denied, true if the + * connection request should proceed. If false is returned the + * connection attempt will receive a SQLException with SQL State + * 08004. * - * @exception java.sql.SQLException An exception processing the request, connection request will be denied. - The SQL exception will be returned to the connection attempt. + * @exception java.sql.SQLException An exception processing the request, + * connection request will be denied. The SQL exception will + * be returned to the connection attempt. */ public boolean authenticateUser(String userName, String userPassword,