pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: jkew@tableau.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13782: gss auth with libpq does not include realm by default
Date: Mon, 23 Nov 2015 16:30:03 -0500
Message-ID: <20151123213002.GI3685@tamriel.snowman.net> (raw)
In-Reply-To: <20151123210456.1832.54972@wrigleys.postgresql.org>
References: <20151123210456.1832.54972@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

John,

* jkew@tableau.com (jkew@tableau.com) wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      13782
> Logged by:          John Kew
> Email address:      jkew@tableau.com
> PostgreSQL version: 9.5beta1
> Operating system:   Windows 7
> Description:        
> 
> Recently a change was made to set include_realm=1 by default. This is
> sensible.
> 
> Clients and drivers using libpq, however, default to sending just the
> username w/o the realm, leading to a gss username error in these
> configurations.

That's not exactly correct.  libpq does not determine the username to
send to the server based on the auth method chosen by the server.  The
username is chosen based on what the OS tells libpq the local username
is.

> You can force psql and postgres-odbc to use a specific username which
> includes the realm; but it would be useful if libpq had the same default as
> the server and sent the current realm by default e.g: joe@realm.com.

Note that the username sent is the PG user to log in as.  If libpq sent
this then there would have to exist a 'joe@realm.com' user in the PG
database.  That's certainly possible to do with PG, but, in my view at
least, it comes across a bit like having unix users named
'joe@realm.com', which isn't typical.

> Seems like a minor thing; but it means you can share the same connection
> string configuration between users for when postgres is configured the
> recommended way.

The recommendation is to use include_realm=1, but that doesn't imply
that users in the database should be 'joe@realm.com'- that's a
completely different consideration.

I would suggest you refer to pg_ident.conf and the mapping capabilities
available there to see how you can have a 'joe' unix/Windows user, a
'joe' PG user, and have include_realm=1 by having a mapping in
pg_ident.conf which allows the system-identified user of 'joe@realm.com'
to connect as the PG user 'joe'.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (2+ messages)

Message-ID: <20151123213002.GI3685@tamriel.snowman.net>
Permalink:  ../20151123213002.GI3685@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20151123213002.GI3685@tamriel.snowman.net

 · 

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-bugs@postgresql.org
  Cc: sfrost@snowman.net, jkew@tableau.com
  Subject: Re: BUG #13782: gss auth with libpq does not include realm by default
  In-Reply-To: <20151123213002.GI3685@tamriel.snowman.net>
  References: <20151123210456.1832.54972@wrigleys.postgresql.org> <20151123213002.GI3685@tamriel.snowman.net>

* 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