pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: owenn panng <trilogy@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: converting to MD5
Date: Tue, 19 Oct 2004 12:00:54 -0600
Message-ID: <c1158fd10410191100261728eb@mail.gmail.com> (raw)

Hi there, I was wondering what is needed to done on both the postgres
& client side to connect via MD5.  Right now, we are connecting fine
by just specifying password in pg_hba.conf:
host   database      user xxx.xxx.xxx.xxx   xxx.xxx.xxx.xxx   password

But I would like to change this to use:
host   database      user xxx.xxx.xxx.xxx   xxx.xxx.xxx.xxx   md5

I have the user stored in pg_shadow (note: the passwd listed is not
the real one):
 usename  | usesysid | usecreatedb | usesuper | usecatupd |           
   passwd                | valuntil | useconfig
 user  |      100 | t           | f        | f         |
md59033f409a99f207fa816b990467a9999 |          |

On the client side, we are using pg74.215.jdbc2.jar with code based on
the example given on
http://jdbc.postgresql.org/documentation/pgjdbc.html

    String url = "jdbc:postgresql://" + host + "/" + database;
    try {
    Class.forName("org.postgresql.Driver");
                                                                      
                                                          con =
DriverManager.getConnection(url, userID, password);
                                                                      
                                                          }

I can generate the same password that matches the one stored in
pg_shadow.  So how do I specify that the password I am sending is in
MD5?  Any help would be appreciated.

Thanks, O.



view thread (3+ messages)  latest in thread

Message-ID: <c1158fd10410191100261728eb@mail.gmail.com>
Permalink:  ../c1158fd10410191100261728eb@mail.gmail.com/
Also on:    postgresql.org/message-id/c1158fd10410191100261728eb@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: trilogy@gmail.com
  Subject: Re: converting to MD5
  In-Reply-To: <c1158fd10410191100261728eb@mail.gmail.com>
  References: <c1158fd10410191100261728eb@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox