From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Bryn Llewellyn <bllewell@icloud.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should
Date: Sat, 29 Oct 2022 10:14:04 -0700
Message-ID: <b6bc9855-a4bb-d9a3-a60e-bf3bf6be9332@aklaver.com> (raw)
In-Reply-To: <9801E977-425C-41BF-B024-19BC875940C0@icloud.com>
References: <9801E977-425C-41BF-B024-19BC875940C0@icloud.com>
On 10/28/22 17:23, Bryn Llewellyn wrote:
> Adrian, thank you for your reply to my « Seeking the correct term of art
> for the (unique) role that is usually called "postgres"... » thread here:
>
> It got me in without error. (And, as hoped for, there was no password
> challenge.) But "select current_role" showed that the mapping had been
> ignored and that I was connected again as "bob".
>
> *What am I doing wrong?*
You skipped over this part of my post and the documentation:
Section 21.2
"The map-name is an arbitrary name that will be used to refer to this
mapping in pg_hba.conf."
This example below id for the ident auth method but the same syntax
applies to peer.
https://www.postgresql.org/docs/current/auth-pg-hba-conf.html
# TYPE DATABASE USER ADDRESS METHOD
host all all 192.168.0.0/16 ident
map=omicron
pg_ident.conf and pg_hba.conf are two separate files and the only way
information gets from the former to the latter is if you explicitly
include the map name under METHOD for the the auth line.
--
Adrian Klaver
adrian.klaver@aklaver.com
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-general@postgresql.org
Cc: adrian.klaver@aklaver.com, bllewell@icloud.com, david.g.johnston@gmail.com
Subject: Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should
In-Reply-To: <b6bc9855-a4bb-d9a3-a60e-bf3bf6be9332@aklaver.com>
References: <9801E977-425C-41BF-B024-19BC875940C0@icloud.com> <b6bc9855-a4bb-d9a3-a60e-bf3bf6be9332@aklaver.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