By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,903 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,903 IT Pros & Developers. It's quick & easy.

Manually authenticating users in pg_shadow

P: n/a
Is there a way, having a user entered username and password, to select a single row from pg_shadow which is using md5 password encryption?

I'm currently authenticating web users (.asp page) with our own user table that uses crypt() to store passwords. I'd like to remove our 'redundant' user table and use pg_shadow. The authentication function I'm using is included in the attachment...

Thanks.

<<auth_user.txt>>
William Harazim, Software Engineer, Fulco Inc. 973-627-2427, x129

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"William Harazim" <wh******@fulcoinc.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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.