Skip site navigation (1) Skip section navigation (2)

ident auth postgres 7.4 fedora core 3

From: Todd Gee <toddgee(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: ident auth postgres 7.4 fedora core 3
Date: 2005-03-07 06:28:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Hey Folks ->

So I just upgraded my RH 9 box to Fedora Core 3 and ident auth
stopped working.  I've been thru the ident authorization process
before and have become pretty conversant w/ it, but this issue is
really strange.  It seems that ident auth is only failing w/ JDBC

postgres version: postgresql-7.4.7-3.FC3.1
(includes JDBC driver jar pg74.215.jdbc3.jar)

I have the relevant line in my pg_hba.conf file:
host   all   all     ident sameuser

I have a user 'tod' created in postgres and I can connect using the
following command issued as (unix) user tod:
[tod(at)pedro ~]$ psql -h localhost -U tod cbfsrtsDev
which connects using tcp sockets and should thus exercise the above
line in the pg_hba.conf file.  (I have verified this by changing host
auth to 'password' and verifying that psql asks me for a password
before letting me in.)  Yes, I realize the "-U tod" is redundant. 
The command works the same with or without it.

Anyway, I am using this java program for a test (which I found in a
previous thread on this list):
----------- Begin include
import java.sql.*;

public class JdbcTest {
    public static void main(String[] args) throws Exception {

        String url = "jdbc:postgresql:cbfsrtsDev";
        Connection db = DriverManager.getConnection(url, args[0],
----------- End include

As you can see, I'm trying to connect to the same table 'cbfsrtsDev'
with the username and password set to the same thing.  When I run
this, I receive:
[tod(at)pedro ~]$ java JdbcTest tod
----------- Begin include
Exception in thread "main" org.postgresql.util.PSQLException: A
connection error has occurred: org.postgresql.util.PSQLE
xception: FATAL: IDENT authentication failed for user "tod"

        at org.postgresql.Driver.connect(
        at JdbcTest.main(
----------- End include

So, my question is this: how can I use ident auth to authenticate for
the psql terminal session but have my java program fail?  I even
checked to ensure that the java process wasn't set-UIDed (it's not). 
I tried the other JDBC drivers, but the results are all the same.

If anyone has any suggestions, I'd love to hear 'em.


pgsql-jdbc by date

Next:From: Tom LaneDate: 2005-03-07 07:16:02
Subject: Re: ident auth postgres 7.4 fedora core 3
Previous:From: Oliver JowettDate: 2005-03-06 22:42:26
Subject: Re: [BUGS] BUG #1523: precision column value returned from getTypeInfo()

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group