Thread: Frontend/backend protocol authentication

Frontend/backend protocol authentication

From
Peter Schuller
Date:
Hello,

I'm attempting to implement a PosrgreSQL client in Squeak. I'm sending
what I believe to be a correct StartupPacket, but PostgreSQL
responds with an ErrorResponse: "FATAL 1: Password auth. failed...".

But I never asked for password authentication! According to the protocol
docs on the site, I should first be getting an Authentication* packet (I
think, an AuthenticationUnencrpytedPassword - but that one is not
documented), to which I should send a PasswordPacket. But now it returns
error before I get a chance.

What might I be doing wrong?

And am I correct in expecting an AuthenticationUnencryptedPassword
packet? Postgresql is set to use the "password" authentication method,
and another exising PostgreSQL protocol implementation failed because it
receivd such a packet (instead of some other one it expected).

Thanks,

--
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>'
Key retrival: Send an E-Mail to getpgpkey@scode.org
E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org





Re: Frontend/backend protocol authentication

From
Tom Lane
Date:
Peter Schuller <peter.schuller@infidyne.com> writes:
> I'm attempting to implement a PosrgreSQL client in Squeak. I'm sending
> what I believe to be a correct StartupPacket, but PostgreSQL
> responds with an ErrorResponse: "FATAL 1: Password auth. failed...".

> But I never asked for password authentication!

Uh, what *do* you have in pg_hba.conf, then?

It might also help to look at the postmaster's log (stderr or syslog
output) --- many kinds of auth failures report more info in the log
than they are willing to tell the client.

            regards, tom lane

PS: this seems more on-topic for pgsql-interfaces than -general.



Re: Frontend/backend protocol authentication

From
Peter Schuller
Date:
> > But I never asked for password authentication!
>
> Uh, what *do* you have in pg_hba.conf, then?

What I meant was, I never initiated any form av password authentication.
I ONLY send the StartupPacket. pg_hba.conf does state that it should use
password auth., but the server returns an authentication error to me
before I have even sent the password.

> It might also help to look at the postmaster's log (stderr or syslog
> output) --- many kinds of auth failures report more info in the log
> than they are willing to tell the client.

Thanks, I'll do that.

> PS: this seems more on-topic for pgsql-interfaces than -general.

Ah, ok. I figured -interfaces was more for JDBC issues and such. I'll
post there in the future, thanks!

--
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>'
Key retrival: Send an E-Mail to getpgpkey@scode.org
E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org