Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQWep-0002jz-B2 for pgsql-novice@arkaria.postgresql.org; Sun, 28 Mar 2021 14:44:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lQWeo-0004mz-9Z for pgsql-novice@arkaria.postgresql.org; Sun, 28 Mar 2021 14:44:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQWeo-0004mr-39 for pgsql-novice@lists.postgresql.org; Sun, 28 Mar 2021 14:44:50 +0000 Received: from mout.gmx.net ([212.227.17.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQWek-0004IH-PI for pgsql-novice@lists.postgresql.org; Sun, 28 Mar 2021 14:44:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1616942685; bh=hT/lD4BJt8a0CDjsJ+MbTz9PQVhr+MlcggsdiV7y1vw=; h=X-UI-Sender-Class:Date:From:To:Subject:In-Reply-To:References; b=demaXNFuxNm3iZ/mgj0Wr6/6riMJCuglL628Bi9pwV7ggxIjQe7bOWPW21rt4BcAr rxjLZvR7Ke4tt41mLnydIm4Csgh5bf0zdw9L+OnPqNXJKzFd0uKz0/vrBcu5libCpi o7z52CdskB4AP+xymfArFcWNI19YRB4MrWWvw2QQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from mail.defcon1.lan ([93.15.31.113]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1N6KUT-1lg9rg1MF7-016fLo for ; Sun, 28 Mar 2021 16:44:45 +0200 Date: Sun, 28 Mar 2021 16:44:43 +0200 From: Bzzzz To: pgsql-novice@lists.postgresql.org Subject: Re: Application trying to use wrong user when logging into the database Message-ID: <20210328164443.699bba10@msi.defcon1.lan> In-Reply-To: References: <20210328160004.58d5426d@msi.defcon1.lan> Organization: Anyone, anywhere BUT in banana demokratik republik of france and UERSS. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:lZO+kfq0cwq35BvS3f+lkXdxxLX8kRC7Gvv9WAOX4f63DohujpL It7e3pYT4zHlyYFzAcFDgnwZQKyOluH55pqFC+rkOAxQsK5T7i+bPSjHbEEBLnhH2dRNOdq ku6ImTjMRBfSS7zawlL7iakQtD5AvVV2ZcZn+W0fQsvt5NW0t14NtHZy7uGy4Tq15/zftSX 6uC8tGv6nw2+FefEr9xdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:QrHNIBxqLwA=:CCrDmYaEJl794b7AQziFnN 76FSKNehZWTYZxwQ9MlxTp7PgpAvP4CRhPlFBcRn2CEgKwCeVkcFtsisNnr7krkMUB01+BCg1 b/KYHO1j8GwgBFOUoI1Bl/vEsaWECQFhTFdCzkRs2LgZEPZ9gr9QCtKnhzQ2IPjZJRV/PGTqH /xRCCkd/tg3Y+/SZU5kQ0DV4OnrV8JAlwvU485WnfG+X6X9aJ3ewuLeQ/VyRlJiBvIhMUkbO5 ppKLt9+u7aBpI8C3dBJYG+rqTAVJVD3HLNp9hy2cQip3R6NvvWWROoNt4UxXxSqK0rimxRa0H HQ52ErRfC3J2EOWQURYioUn/ieJ1hlbqYJKIVGjwnOIZIfTaradEWdl56Pv9sYvUMgLZB/635 NafCBUJhKTRY4BAAjj++Lbz7U2Yn5UX9cabKkd6ofgvFBXhHr/lHyNbwcGZLk7nDAy1ygldsC SCMA61PJczGL6z9U+N/0DuyL0GbomDPknbPVO034SoyeQfWE0N/rf6qOxhiq9IELP5ViQyTeg G8sM2ph3tQd9Q4O69hFxkOSOeWPo76rW58qzLRpUbE9F2vgEqBEv+Za/KmofLRjg6mBUtVA+L /NWt3WiP1+qo6Pxwnbzaz07RhdfHkxSub9+Sw8MCjKRo4D7DP1+xOLr0tqmgm6vqa7jFrFV4+ /tIdXHwwsBy78xLw0HeGMRxP0cmD/ewRahfw562ovb1r5cqIjuWMoAZFu9knqbYY9eDj7zROw gko4TiZD8B11ADXfWIvG5o8etca9wN0jiZQB2AoXYoegZd2J/m85H1BHOs2Ipx34qTJGminSp O9bSVi9MhV/4hWPMhGrCUgef6fT36PNbnPBJZ/PP7kANNxp9i7yX3foJNrLLUkKPOGH1Cyy10 O5Yzoy7nlcatKycZZofgQyS5jcfH6idio5osoqvfLvJ+l1Jw5ES3JB62edS82ZPnkioI//DeG cO4tribZp9GuGM0F8ayYf3M417wPpAeqPp7i/LKSGpKCSVS0Ys4CM/XKwz6uLaRzF4JLqQpGo 5/BXF1IvV3/pAg4ZDBC5Nik7XJ9GdtQdWAg8aKXpfBX1R1GOU6ya+vJQHzqpCy8u4FME6wPRZ EnwPWKnYgVAIisq+A0IkI+elmHeo6UOTMmGvJZmOYJttX7D6BZ/HZ0/sKZRo2Pzg05jcbg2Zz aCoM6oHEKkLl0XM6enPOpWVemN/dU8bgI73k2ce99OIJcFjW4v4ca7kyAGnXieiPLx1ek= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 28 Mar 2021 14:21:29 +0000 Simon Connah wrote: Rahhhh, it was sent directly to you instead of the ML :((( re-sending it. >=20 >=20 > =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original = Message =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 >=20 > On Sunday, March 28th, 2021 at 15:00, Bzzzz wrote: >=20 > > On Sun, 28 Mar 2021 13:44:59 +0000 > >=20 >=20 > > Simon Connah simon.n.connah@protonmail.com wrote: > >=20 >=20 > > Hi, > >=20 >=20 > > > But instead of using my > > >=20 >=20 > > > applications role which I created in PostgreSQL it is trying to > > > use my > > >=20 >=20 > > > Linux user name "simon" and is failing authentication because of > > > it. > > >=20 >=20 > > > I'm just confused at the moment. At no point in time have I > > > created a > > >=20 >=20 > > > role called "simon" and I have never tried to connect to any of my > > >=20 >=20 > > > databases using the role name "simon", so why is it trying to > > >=20 >=20 > > > authenticate as "simon"? > >=20 >=20 > > Read this and check you're not in this case : > >=20 >=20 > > https://www.dbrnd.com/2016/12/postgresql-pg_ident-conf-to-map-operating= -system-username-and-database-username-external-authentication-password/ > >=20 >=20 > > Jean-Yves >=20 > Thank you for your reply. My pg_ident.conf file is completely empty > (well all commented out at least). Do you really need to map a Linux > system user to a PostgreSQL role to get this to work? Seems like a bit > of a hack to me. I'm probably missing something simple again. I don't > need external access to the database at the moment, although it is > helpful knowledge to have for the future. >=20 > This is all on my local machine so I've set pg_hba.conf to md5 for > 127.0.0.1/32 which I assumed would just make it work. >=20 > Simon. Normal > Do you really need to map a Linux > system user to a PostgreSQL role to get this to work? =20 Not at all, as they have nothing in common, except if you use a system user of course - this looks like just a facility. > Seems like a bit > of a hack to me. I'm probably missing something simple again. I don't > need external access to the database at the moment, although it is > helpful knowledge to have for the future. =20 As your file's empty, this can only come from your app (hehehe), so try to launch it under another user to see if it takes the username of the launcher by default, which seems to be the case (you launched it under the Linux username 'simon', didn't you !?) Check the docs to find what is the behavior of the js Pg driver. Double check your configuration file has the right username _and_ that it is effectively read by your app (trace each steps w/ prints or logs). If nothing works, re-write your app in Cobol ;-p) Jean-Yves