Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UBSSJ-0008D8-Kx for pgsql-jdbc@arkaria.postgresql.org; Fri, 01 Mar 2013 16:05:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UBSSJ-0006N7-0t for pgsql-jdbc@arkaria.postgresql.org; Fri, 01 Mar 2013 16:05:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UBSSI-0006N0-H6 for pgsql-jdbc@postgresql.org; Fri, 01 Mar 2013 16:05:06 +0000 Received: from smtp.n-able.com ([66.46.200.5]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UBSSD-00013i-RN for pgsql-jdbc@postgresql.org; Fri, 01 Mar 2013 16:05:05 +0000 Received: from oscar.engineering.n-able.com (192.168.20.186) by exchange.office.n-able.com (192.168.10.60) with Microsoft SMTP Server (TLS) id 8.2.176.0; Fri, 1 Mar 2013 11:06:25 -0500 Received: from oscar.engineering.n-able.com (localhost.localdomain [127.0.0.1]) by oscar.engineering.n-able.com (8.14.6/8.14.5) with ESMTP id r21G4x2Y022174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 1 Mar 2013 11:04:59 -0500 Received: (from mattrose@localhost) by oscar.engineering.n-able.com (8.14.6/8.14.6/Submit) id r21G4xfG022173 for pgsql-jdbc@postgresql.org; Fri, 1 Mar 2013 11:04:59 -0500 X-Authentication-Warning: oscar.engineering.n-able.com: mattrose set sender to mrose@n-able.com using -f Date: Fri, 1 Mar 2013 11:04:59 -0500 From: Matt Rose To: Subject: pgsql-jdbc and ident Message-ID: <20130301160459.GA12543@oscar.engineering.n-able.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org I am having the oddest problem with postgresql-9.2-1002.jdbc3.jar doing ident authentication against postgresql-9.2.3 I have in my pg_ident.conf the following entries # MAPNAME SYSTEM-USERNAME PG-USERNAME nusers root postgres nusers root sqlrelay nusers nable sqlrelay and pg_hba.conf has the following entry. host all all 127.0.0.1/32 ident map=nusers and when I test the following configuration with psql, everything works perfectly: [root@localhost]# psql mickey sqlrelay -h 127.0.0.1 psql (9.2.2) Type "help" for help. mickey=> and I can even see the identd server getting the ident auth request from postgresql and return the correct string Mar 1 10:46:58 localhost oidentd[31730]: Connection from localhost (127.0.0.1):56502 Mar 1 10:46:58 localhost oidentd[31730]: [localhost] Successful lookup: 37704 , 5432 : root (root) However, when I try and connect with a simple jdbc tester that I made, I get the following. [root@localhost]# java -jar /home/admin/pgtest.jar Running as user 'root' postgresql JDBC Driver Registered! SQLException: FATAL: Ident authentication failed for user "sqlrelay" SQLState: 28000 VendorError: 0 Exception in thread "main" java.lang.NullPointerException at net.folkwolf.PostgreSQLJDBCDriverTest.main(PostgreSQLJDBCDriverTest.java:35) and even in the logs I see that, even tho the JDBC is authenticating as root, the ident server is returning NO-USER Mar 1 10:48:14 localhost oidentd[31745]: Connection from localhost (127.0.0.1):42316 Mar 1 10:48:14 localhost postgres[31744]: [64-1] LOG: 00000: invalidly formatted response from Ident server: "37705,5432:ERROR:NO-USER#015 Mar 1 10:48:14 localhost postgres[31744]: [64-2] #011" Mar 1 10:48:14 localhost postgres[31744]: [64-3] LOCATION: ident_inet, auth.c:1743 Mar 1 10:48:14 localhost postgres[31744]: [65-1] FATAL: 28000: Ident authentication failed for user "sqlrelay" Mar 1 10:48:14 localhost postgres[31744]: [65-2] LOCATION: auth_failed, auth.c:302 I've tried both kinds of connection calls, both the conn = DriverManager.getConnection("jdbc:postgresql://127.0.0.1:5432/mickey", "sqlrelay",null); and conn = DriverManager.getConnection("jdbc:postgresql://127.0.0.1:5432/mickey?user=sqlrelay"); with identical results. Can anyone help me figure out what I'm missing here? -- Matt Rose, Systems Engineer, N-able Technologies: mrose@n-able.com -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc