pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dustin C. Hatch <admiralnemo@dchweb.com>
To: pgsql-admin@postgresql.org
Subject: IDENT authentication with md5 fallback
Date: Wed, 10 Jan 2007 07:36:49 -0600
Message-ID: <45A4EBF1.1090303@dchweb.com> (raw)

Hello,

I was wondering if there is a way I can set up my pg_hba.conf to allow 
"ident sameuser" authentication, but fall back to "md5" if it fails.  I 
would like users to be able to login to their databases (which 
correspond to their usernames and ident responses), however when they 
need to use PHP to login, they must enter a password because the ident 
response will be different (always "apache" I would assume).

I have tried the following pg_hba.conf configurations, but I cannot seem 
to get this right.

This results in only allowing users to login after entering the correct 
password:
local           sameuser        all                                     md5
local           sameuser        all                                     
ident sameuser

This results in ident checking and returning FATAL without asking for a 
password if it fails:
local           sameuser        all                                     
ident sameuser
local           sameuser        all                                     md5

So, how would I configure pg_hba.conf to work like this?  Is it 
possible, or should I only allow md5 and not worry about ident?  Please 
let me know.

-- 
Dustin C. Hatch
http://www.dchweb.com

Message-ID: <45A4EBF1.1090303@dchweb.com>
Permalink:  ../45A4EBF1.1090303@dchweb.com/
Also on:    postgresql.org/message-id/45A4EBF1.1090303@dchweb.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-admin@postgresql.org
  Cc: admiralnemo@dchweb.com
  Subject: Re: IDENT authentication with md5 fallback
  In-Reply-To: <45A4EBF1.1090303@dchweb.com>
  References: <45A4EBF1.1090303@dchweb.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