Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a0ygZ-0000KU-2l for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Nov 2015 21:30:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a0ygY-0004vG-LL for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Nov 2015 21:30:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a0ygY-0004um-1w for pgsql-bugs@postgresql.org; Mon, 23 Nov 2015 21:30:06 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1a0ygV-0001Ga-In for pgsql-bugs@postgresql.org; Mon, 23 Nov 2015 21:30:04 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 26BC55F7A2; Mon, 23 Nov 2015 16:30:03 -0500 (EST) Date: Mon, 23 Nov 2015 16:30:03 -0500 From: Stephen Frost To: jkew@tableau.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13782: gss auth with libpq does not include realm by default Message-ID: <20151123213002.GI3685@tamriel.snowman.net> References: <20151123210456.1832.54972@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tZ+QNGr5Vcs/X9Kn" Content-Disposition: inline In-Reply-To: <20151123210456.1832.54972@wrigleys.postgresql.org> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-61-generic (x86_64) X-Uptime: 16:06:53 up 111 days, 5:37, 10 users, load average: 0.26, 0.15, 0.11 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --tZ+QNGr5Vcs/X9Kn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable John, * jkew@tableau.com (jkew@tableau.com) wrote: > The following bug has been logged on the website: >=20 > Bug reference: 13782 > Logged by: John Kew > Email address: jkew@tableau.com > PostgreSQL version: 9.5beta1 > Operating system: Windows 7 > Description: =20 >=20 > Recently a change was made to set include_realm=3D1 by default. This is > sensible. >=20 > 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=3D1, 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=3D1 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 --tZ+QNGr5Vcs/X9Kn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJWU4VaAAoJEO1sijiDR2RVbL8P/0hfVYtUNjz2LGdyuFna1MG9 VtG0FgwGrOMsSnL0I/cgd8qZKW31/yccysv98OMUsyw54QswQriAMRMENVF/hQzU cPtQg2uhL3fWJ4kUzCIaUfklidtrj8JS/1ZCyN+2MmEEl0hQKt+qTF6R6nR51DO+ JPG63SUMBplSyRi1wj7XfyhktaXBKKnOkCQHs4JNmBeZO/MsH1z3nZQCrOKWoMwd n0eY3ywumQRDaxkzjtItMUcmDq+TXwzr03Fr5OjOS3yZtVIEVF6Wybaxzb8WO1xI 1Dx6EKfjmWeWVGTsW+1G6xDxIM16kjl4hQFgMYbnExLKOTME0oiD3xisxyYE7dVW lpSip5U67K7PrzltWebBQHwMGErx4XKhABC4jBH48m6CpULcy//vTx8hC7n7fgHs 2wyEdtEWZ7cD00t/WGRvc3sDgOK22B2yn9aBB0at8E0Phyoyirn+VU//T+Az/eC8 navIwNpaGLBfxiwGNmhU6nFLG/b0zO37Nq/3aTgMMceiLfQK0wvafhKUkxRk4BYy I2KnROr9cDfxuNLZIh5visB9Ymw8YMlnj6zqMn8JVO/jHfeeQlzKWCoHSa007fWm UVZ1VkKt+6fKI9RPUzFaMK6eGLgg4g0XcNmwgbnLOUREv/5NRN+nJ4f5bOvT1KK0 TxB6RDkIypxgZcUroTmQ =Kk21 -----END PGP SIGNATURE----- --tZ+QNGr5Vcs/X9Kn--