Re: Manually authenticating users in pg_shadow

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "William Harazim" <wharazim(at)fulcoinc(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Manually authenticating users in pg_shadow
Date: 2004-01-28 00:55:15
Message-ID: 2151.1075251315@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"William Harazim" <wharazim(at)fulcoinc(dot)com> writes:
> Is there a way, having a user entered username and password, to select a si=
> ngle row from pg_shadow which is using md5 password encryption?

I think what you need to know is that the stored passwd field is formed
thus:

'md5' || md5(password || username);

Substitute this for your crypt() call and you're set. Don't think you
need the separate step to extract salt (you didn't need it before
either, really).

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jerome Lyles 2004-01-28 01:08:23 Re: Permission Problems:-)?
Previous Message Colm De Barra 2004-01-28 00:36:36 Fw: postgres DB duplication