Got password authentication working using postgres functions.