You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by startx <st...@plentyfact.org> on 2010/10/12 12:24:40 UTC

[users@httpd] problem with authn_dbd / auth digest and sqlite3

hello.

i am trying to set up AuthDigest against a sqlite3 database
using mod_authn_dbd ( system is Debian squeeze) and it seems
i am missing something.

i created a user database for a user "myself" with password "foobar" in
realm "admin". the password prompt shows up  but any login attempt
fails ( get prompted again) and my error log reports :

     "Digest: user `myself' in realm `admin' not found.

why is that? anybody can point me into a direction?


my sqlite3 database looks like this  

          password              | username |  realm
----------------------------------------------------
4c324a0a70009f01e9804e1326c51ae9|myself|admin


and this looks alright to me, no?


i created the password with   "echo -n 'myself:admin:foobar' | md5sum"
( i double checked with htdigest, but the output was the same)


from my vhost:

###### from my vhost file ####

DBDriver sqlite3
DBDParams "/home/myself/web/authn.db"
DBDMin  1
DBDKeep 2
DBDMax  10
DBDExptime 60

ErrorLog /var/log/apache2/error.log

<Directory /home/myself/web/public/admin>
    AuthType Digest
    AuthName admin
    AuthDigestProvider dbd
    Require valid-user
    AuthDBDUserRealmQuery "SELECT password FROM user WHERE  username =@USERNAME and realm = @REALM; " 
</Directory>

################

startx


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with authn_dbd / auth digest and sqlite3

Posted by Igor Galić <i....@brainsware.org>.
----- "startx" <st...@plentyfact.org> wrote:

> On Tue, 12 Oct 2010 09:38:12 -0700
> Dave Mansfield <dm...@sbcglobal.net> wrote:
> 
> > >
> > >   
> > Sorry - your problem is your AuthDBDUserRealmQuery - the params are
> 
> > '%s', not @USERNAME, etc:
> > 
> >   AuthDBDUserRealmQuery "Select password FROM user WHERE
> username=%s
> > and realm=%s"
> > 
> 
> cheers, you are right. i got misguided by this tutorial here:
> http://www.helicontech.com/ape/doc/mod_authn_dbd.htm

The official documentation:
http://httpd.apache.org/docs/current/mod/mod_authn_dbd.html#authdbduserrealmquery

> :(
> 
> it works now, thousend thanks,
> 
> startx

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with authn_dbd / auth digest and sqlite3

Posted by startx <st...@plentyfact.org>.
On Tue, 12 Oct 2010 09:38:12 -0700
Dave Mansfield <dm...@sbcglobal.net> wrote:

> >
> >   
> Sorry - your problem is your AuthDBDUserRealmQuery - the params are 
> '%s', not @USERNAME, etc:
> 
>   AuthDBDUserRealmQuery "Select password FROM user WHERE username=%s
> and realm=%s"
> 

cheers, you are right. i got misguided by this tutorial here:
http://www.helicontech.com/ape/doc/mod_authn_dbd.htm

:(

it works now, thousend thanks,

startx

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with authn_dbd / auth digest and sqlite3

Posted by Dave Mansfield <dm...@sbcglobal.net>.

startx wrote:
> On Tue, 12 Oct 2010 08:52:31 -0700
> Dave Mansfield <dm...@sbcglobal.net> wrote:
>
>   
>> startx wrote
>>     
>
>   
>>> from my vhost:
>>>
>>> ###### from my vhost file ####
>>>
>>> DBDriver sqlite3
>>> DBDParams "/home/myself/web/authn.db"
>>>     
>>>       
>
>   
>> STW for examples of SQLite connection strings.
>>     
>
> hi.
>
>   
>> STW
>>     
>
> i did, for quite a while actually.  you answer confuses me, the
> connection string
>
> DBDParams "/home/myself/web/authn.db"
>
> seems to work fine (at least it works perfectly with AuthBasic) and
> there is no connection error logged.
>
>   
Sorry - your problem is your AuthDBDUserRealmQuery - the params are 
'%s', not @USERNAME, etc:

  AuthDBDUserRealmQuery "Select password FROM user WHERE username=%s and 
realm=%s"


-- D Mansfield


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with authn_dbd / auth digest and sqlite3

Posted by startx <st...@plentyfact.org>.
On Tue, 12 Oct 2010 08:52:31 -0700
Dave Mansfield <dm...@sbcglobal.net> wrote:

> startx wrote

> > from my vhost:
> >
> > ###### from my vhost file ####
> >
> > DBDriver sqlite3
> > DBDParams "/home/myself/web/authn.db"
> >     

> STW for examples of SQLite connection strings.

hi.

> STW

i did, for quite a while actually.  you answer confuses me, the
connection string

DBDParams "/home/myself/web/authn.db"

seems to work fine (at least it works perfectly with AuthBasic) and
there is no connection error logged.

startx

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] problem with authn_dbd / auth digest and sqlite3

Posted by Dave Mansfield <dm...@sbcglobal.net>.

startx wrote:
> hello.
>
> i am trying to set up AuthDigest against a sqlite3 database
> using mod_authn_dbd ( system is Debian squeeze) and it seems
> i am missing something.
>
> i created a user database for a user "myself" with password "foobar" in
> realm "admin". the password prompt shows up  but any login attempt
> fails ( get prompted again) and my error log reports :
>
>      "Digest: user `myself' in realm `admin' not found.
>
> why is that? anybody can point me into a direction?
>
>
> my sqlite3 database looks like this  
>
>           password              | username |  realm
> ----------------------------------------------------
> 4c324a0a70009f01e9804e1326c51ae9|myself|admin
>
>
> and this looks alright to me, no?
>
>
> i created the password with   "echo -n 'myself:admin:foobar' | md5sum"
> ( i double checked with htdigest, but the output was the same)
>
>
> from my vhost:
>
> ###### from my vhost file ####
>
> DBDriver sqlite3
> DBDParams "/home/myself/web/authn.db"
>   
STW for examples of SQLite connection strings.

-- D Mansfield


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org