[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with AuthCookieName and Apache



On Thu, Apr 21, 2005 at 07:40:43PM +0200, Francisco Castillo wrote:
> (...)
> The authentications works, if i insert the login and pass it validates, the
> problem is that cookie_auth_module must take the VisitorID cookie and pass
> it to the auth_module but it is not happening.

If all else fails, you might want to build the module yourself to have
it print some useful debugging information.  To do so:

(1) get the source

http://raburton.lunarpages.com/apache/mod_auth_cookie/13/mod_auth_cookie.c

(2) install the debian package apache-dev (unless you already have)

(3) if you want extended debugging, apply my patch below -- recommended
    (the original source comes with only very minimal debugging info)

(4) build mod_auth_cookie.so (with debugging)

$ apxs -DDEBUG -c mod_auth_cookie.c

(5) copy the resulting .so to /usr/lib/apache/1.3/ and restart apache

In the apache error log you should then find a set of messages like

mod_auth_cookie: configured cookie name = 'VisitorID'                                                                   
mod_auth_cookie: found cookie: 'VisitorID=almut:abcd1234'                                                               
mod_auth_cookie: UUencoded 'almut:abcd1234' as 'YWxtdXQ6YWJjZDEyMzQA'                                                   
mod_auth_cookie: passing 'almut:abcd1234' as 'Basic YWxtdXQ6YWJjZDEyMzQA' to next auth module                           

for every request, if things are working as intended.  Otherwise,
you'll get different messages -- which you might post here, in case
they leave you clueless... ;)

Good luck,
Almut


-------------------- >8 --------------------
155c155
<   fprintf(stderr,"UUencoded `%s' as `%s'\n",szFrom, result);
---
>   fprintf(stderr,"mod_auth_cookie: UUencoded '%s' as '%s'\n", szFrom, result);
172,173c172,191
<     if (!sec->cookieName) return DECLINED; /* we're not configured */
<     if (r->connection->user) return DECLINED; /* too late for us to run */
---
>     if (!sec->cookieName)
> #if DEBUG
>     {
>       fprintf(stderr,"mod_auth_cookie: not configured\n");
> #endif
>       return DECLINED; /* we're not configured */
> #if DEBUG
>     } else {
>       fprintf(stderr,"mod_auth_cookie: configured cookie name = '%s'\n", sec->cookieName);
>     }
> #endif
>     if (r->connection->user)
> #if DEBUG
>     {
>       fprintf(stderr,"mod_auth_cookie: user already authenticated\n");
> #endif
>       return DECLINED; /* too late for us to run */
> #if DEBUG
>     }
> #endif
180a199,202
> #if DEBUG
>     {
>       fprintf(stderr,"mod_auth_cookie: Authorization header overriding cookie\n");
> #endif
181a204,206
> #if DEBUG
>     }
> #endif
188a214,216
> #if DEBUG
>       fprintf(stderr,"mod_auth_cookie: found cookie: '%s'\n", cookie);
> #endif
211c239
<       fprintf(stderr,"AuthCookie set `%s'\nas `%s'\n",decode_buf,value);
---
>       fprintf(stderr,"mod_auth_cookie: passing '%s' as '%s' to next auth module\n", decode_buf, value);
213a242,245
> #if DEBUG
>     else
>       fprintf(stderr,"mod_auth_cookie: no cookie found!\n");
> #endif
-------------------- >8 --------------------

Save this as mod_auth_cookie.c.diff, and apply the patch:

$ patch mod_auth_cookie.c mod_auth_cookie.c.diff

To check if everything went allright:

$ md5sum mod_auth_cookie.c
851fd93fe8ef8ad444c11b78f0f0538b  mod_auth_cookie.c

(In case something got garbled by stupid line wrapping MUAs/MTAs, I can
of course also send you the complete patched source off-list.  Just let
me know...)



Reply to: