Re: Application trying to use wrong user when logging into the database
От | Bzzzz |
---|---|
Тема | Re: Application trying to use wrong user when logging into the database |
Дата | |
Msg-id | 20210328164443.699bba10@msi.defcon1.lan обсуждение исходный текст |
Ответ на | Re: Application trying to use wrong user when logging into the database (Simon Connah <simon.n.connah@protonmail.com>) |
Список | pgsql-novice |
On Sun, 28 Mar 2021 14:21:29 +0000 Simon Connah <simon.n.connah@protonmail.com> wrote: Rahhhh, it was sent directly to you instead of the ML :((( re-sending it. > > > ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ > > On Sunday, March 28th, 2021 at 15:00, Bzzzz <lazyvirus@gmx.com> wrote: > > > On Sun, 28 Mar 2021 13:44:59 +0000 > > > > > Simon Connah simon.n.connah@protonmail.com wrote: > > > > > Hi, > > > > > > But instead of using my > > > > > > > applications role which I created in PostgreSQL it is trying to > > > use my > > > > > > > Linux user name "simon" and is failing authentication because of > > > it. > > > > > > > I'm just confused at the moment. At no point in time have I > > > created a > > > > > > > role called "simon" and I have never tried to connect to any of my > > > > > > > databases using the role name "simon", so why is it trying to > > > > > > > authenticate as "simon"? > > > > > Read this and check you're not in this case : > > > > > https://www.dbrnd.com/2016/12/postgresql-pg_ident-conf-to-map-operating-system-username-and-database-username-external-authentication-password/ > > > > > Jean-Yves > > 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. > > 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. > > Simon. Normal > Do you really need to map a Linux > system user to a PostgreSQL role to get this to work? 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. 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
В списке pgsql-novice по дате отправления: