From: Michael Downey <mdowney@esri.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Using GSSAPI/Kerbros/Active Directory: want the database user name to be the full name including the realm name without specifying the user
Date: Mon, 13 Mar 2023 22:12:51 +0000
Message-ID: <BY3PR05MB79857798DF21033009253583DBB99@BY3PR05MB7985.namprd05.prod.outlook.com> (raw)
Good afternoon,
We can successfully connect via GSSAPI/Kerberos using our Active Directory credentials when we map the domain user to a database user that matches the name when the domain information is removed.
When we have a user called mich****
C:\Users\mich2581>"c:\Program Files\PostgreSQL\14\bin"\psql -h dev00*****.esri.com snoopynet**1
Pg_hba:
host all all 0.0.0.0/0 gss include_realm=1 map=map
Pg_ident:
# MAPNAME SYSTEM-USERNAME PG-USERNAME
map /^(.*)@ESRI\.COM$ \1
map /^(.*)@esri\.com$ \1
If we create a database role called mich9999@ESRI.COM<mailto:mich9999@ESRI.COM>, if we run psql or other clients without providing a name with the command, we fail like this:
2023-03-09 16:58:51.732 PST [3654539] LOG: provided user name (mich****) and authenticated user name (mich****@ESRI.COM) do not match
2023-03-09 16:58:51.732 PST [3654539] FATAL: GSSAPI authentication failed for user "mich2581"
If we specify the full name with domain at the command line, it will connect as the role with the full name with domain name. We test that without the mapping set above.
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: mdowney@esri.com
Subject: Re: Using GSSAPI/Kerbros/Active Directory: want the database user name to be the full name including the realm name without specifying the user
In-Reply-To: <BY3PR05MB79857798DF21033009253583DBB99@BY3PR05MB7985.namprd05.prod.outlook.com>
References: <BY3PR05MB79857798DF21033009253583DBB99@BY3PR05MB7985.namprd05.prod.outlook.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