fknx / linqpad-postgresql-driver

LINQPad PostgreSQL Driver
MIT License
43 stars 17 forks source link

ConnectionInfo dialog throws an error for users without a password #4

Closed henrik-m closed 8 years ago

henrik-m commented 8 years ago

The error is only thrown if Integrated Security authentication fails. As it is, it is not possible to perform passwordless authentication with a PostgreSQL user via ConnectionInfo (only with custom connection string). Possible fix: Only assume "Integrated Security" auth when no username is provided. (see PR)

fknx commented 8 years ago

I've merged your fix but I am still getting an ArgumentNullException when trying to open a connection without providing a password. This is probably related to issue npgsql/npgsql#942. Can you confirm this behavior?

henrik-m commented 8 years ago

Curious... I was able to connect to my Postgres instance using this fix. Will test it again tomorrow with current master.

henrik-m commented 8 years ago

I could replicate the ArgumentNullException (String reference not set to an instance of a String. Parameter name: s) on a server which had trust authentication disabled for remote users. This should be handled with a better error message by npgsql. I guess it is indeed related to the ticket you linked.

For my postgres docker image, the exception went away when I changed the following line in /var/lib/data/postgresql/pg_hba.conf

host all all 0.0.0.0/0 md5

to this:

host all all 0.0.0.0/0 trust

Edit: In case you do not want to improve upon the error message I would consider this a problem of npgsql and close the issue.

fknx commented 8 years ago

Yes I'll close this for now. I've subscribed to the Npgsql issue, so I'll verify whether these two issues were related once they release a fix.