Re: Two round for Client Authentication

2018-06-15 Thread Yinjie Lin
Many thanks to Marko and David for your reply. It really helped.

Now I am playing with extension auth_delay, which uses
ClientAuthentication_hook. But I find it not easy to distinguish the first
connection of psql from the second one with empty password, since the
variable 'status' are both STATUS_EOF. Maybe I should dive into the code
deeper.

Regards,


Re: Two round for Client Authentication

2018-06-13 Thread Marko Tiikkaja
On Thu, Jun 14, 2018 at 7:12 AM, Yinjie Lin  wrote:

> Currently I am reading and testing code about Client Authentication, but I
> find that there are two progresses forked if I login using psql, while only
> one progress is forked if using pgAdmin.
>

If psql finds the server asks for a password, it closes the first
connection, displays a password prompt to the user, and then does another
connection attempt with the password the user entered.  You can avoid the
first attempt with the -W flag; though there's usually no reason to do that
in practice.


.m