Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should - Mailing list pgsql-general

From Adrian Klaver
Subject Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should
Date
Msg-id b6bc9855-a4bb-d9a3-a60e-bf3bf6be9332@aklaver.com
Whole thread Raw
In response to "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should  (Bryn Llewellyn <bryn@yugabyte.com>)
Responses Re: "peer" authentication: cannot make "pg_ident.conf" work as I believe that the doc says that it should
List pgsql-general
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




pgsql-general by date:

Previous
From: "jacktby@gmail.com"
Date:
Subject: Re: Re: Does it equal to execute "CREATE ACCESS METHOD"?
Next
From: Eagna
Date:
Subject: How to add a variable to a timestamp.