[PARTIAL SOLVED] Re: Auth user with postgresql

Giuseppe Tofoni gt0057 at gmail.com
Mon Feb 20 23:38:15 UTC 2012


Hi
Unfortunately the problem is partially solved.

postgres_query   "SELECT user FROM usertable "WHERE user=$user AND
pwd=crypt($pass, pwd)";

The crypt function in postgresql works correctly only with the
password created by the htpasswd program, but do not work with
passwords created by PHP.

Best regards, and many thanks.

2012/2/18 Piotr Sikora <piotr.sikora at frickle.com>:
> Hi,
>
>
>> Hi reason, the password is not in MD5, but rather in DES (PHP -->
>> crypt($verpas, CRYPT_STD_DES)
>> What should I use instead of set_md5 ?
>> DES on this page http://wiki.nginx.org/HttpSetMiscModule#Installation
>> is never mentioned
>
>
> I'm not aware of any module that would offer crypt() hashing for variables
> in nginx.conf.
>
> On the bright side, PostgreSQL's crypt() [1] should help you. Could you
> please try:
>
>   postgres_query   "SELECT user FROM usertable
>                    "WHERE user=$user AND pwd=crypt($pass, pwd)";
>
> [1] http://www.postgresql.org/docs/9.1/static/pgcrypto.html
>
>
> Best regards,
> Piotr Sikora < piotr.sikora at frickle.com >
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list