Hi,
I'm having some trouble with getting postgresql auth backend to work.
First minor issue with testing was that connection to Postgresql server does seem to work without password even though I have
local all all trust
in /etc/postgresql/9.1/pg_hba.conf
$ snap-test
no port specified, defaulting to port 8000
snap-test:
Initializer threw an exception...
SqlError {sqlState = "", sqlNativeError = -1, sqlErrorMsg = "fe_sendauth: no password supplied\n"}
Maybe it's a configuration issue. Anyway, after setting a password I managed to start the application
$ snap-test
no port specified, defaulting to port 8000
NOTICE: CREATE TABLE will create implicit sequence "snap_auth_user_uid_seq" for serial column "snap_auth_user.uid"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "snap_auth_user_pkey" for table "snap_auth_user"
NOTICE: CREATE TABLE / UNIQUE will create implicit index "snap_auth_user_login_key" for table "snap_auth_user"
Initializing app @ /
Initializing heist @ /
...loaded 7 templates from /home/tero/af/source/test/snaplets/heist/templates
Initializing CookieSession @ /sess
Initializing postgresql-simple @ /db
Initializing postgresql-auth @ /auth
After this I created a test user "test" and "test".
In the browser and in the access log everything seems to work okay:
$ cat log/access.log
127.0.0.1 - - [18/Dec/2012:16:37:06 +0200] "GET / HTTP/1.1" 200 - - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:06 +0200] "GET /screen.css HTTP/1.1" 200 - "
http://localhost:8000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:06 +0200] "GET /favicon.ico HTTP/1.1" 404 - - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:08 +0200] "GET /new_user HTTP/1.1" 200 - "
http://localhost:8000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:08 +0200] "GET /favicon.ico HTTP/1.1" 404 - - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:10 +0200] "POST /new_user HTTP/1.1" 302 0 "
http://localhost:8000/new_user" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:10 +0200] "GET / HTTP/1.1" 200 - "
http://localhost:8000/new_user" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:10 +0200] "GET /favicon.ico HTTP/1.1" 404 - - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:13 +0200] "POST /login HTTP/1.1" 200 - "
http://localhost:8000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
127.0.0.1 - - [18/Dec/2012:16:37:13 +0200] "GET /favicon.ico HTTP/1.1" 404 - - "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11"
However, nothing is added to the table snap_auth_user:
test=# select count(*) from snap_auth_user;
count
-------
0
(1 row)
and the login obviously fails.
Any ideas?