httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] How to detect failed authentification ?
Date Tue, 15 Aug 2006 15:43:24 GMT
> -----Original Message-----
> From: Marc MENDEZ [mailto:cnmm600@yahoo.fr] 
> Sent: Tuesday, August 15, 2006 5:00 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] How to detect failed authentification ?
> 
> thanks for your answer, that's what I thought.
> 
> But, is there a solution to get a mail *only* when the login failed ?

As I said before... Not as far as I know. A quick look in the code (modules/aaa/mod_auth_basic.c)
shows that mod_auth returns the same value (HTTP_UNAUTHORIZED) if there's no auth header OR
wrong scheme OR password mismatch OR user not found

So you can't tell what caused the request to fail which means that no credentials (first request)
= bad request.

The thing is that Basic Auth is, as the name implies, "basic". If you want to do clever stuff
like you do, you really have to go for a cookie-driven login scheme that has more server-sided
intelligence. Since you're already using PHP, there are lots of PHP-based closed user group
solutions - search on www.php.net.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 



> 
> 
> ----- Original Message ----- 
> From: "Boyle Owen" <Owen.Boyle@swx.com>
> To: <users@httpd.apache.org>
> Sent: Tuesday, August 15, 2006 3:04 PM
> Subject: RE: [users@httpd] How to detect failed authentification ?
> 
> 
> > -----Original Message-----
> > From: Marc MENDEZ [mailto:cnmm600@yahoo.fr]
> > Sent: Tuesday, August 15, 2006 2:32 PM
> > To: users@httpd.apache.org
> > Subject: [users@httpd] How to detect failed authentification ?
> >
> > Hi,
> >
> > On one of my website, the access is controled with a .htaccess file.
> > I defined my own 401 document
> >
> > At the top of this file, I added a php code which sends a 
> mail to the
> > administrator as soon as a user failed to log.
> >
> > I was very surprised to receive mail everytime ! Even if the
> > user succeeds
> > in loging !
> 
> I guess your PHP page is executed anytime the server sends a 
> 401? If so, 
> this is exactly what will happen...
> 
> The server sends a 401 for any request that comes in without valid 
> credentials. So the *first* request, which is sent when the 
> client doesn't 
> even know yet that the resource is protected, already triggers a 401.
> 
> If this surprises you, read this 
> http://en.wikipedia.org/wiki/Basic_authentication_scheme to 
> see how basic 
> auth really works...
> 
> >
> > Why ? How can I solve this ?
> 
> I don't think you can - the server doesn't distinguish between no 
> credentials and bad credentials.
> 
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored.
> 
> >
> >
> >
> >  p4.vert.ukl.yahoo.com uncompressed Tue Aug 15 12:27:00 GMT 2006
> >
> >
> > ______________________________________________________________
> > _____________
> > Découvrez un nouveau moyen de poser toutes vos questions
> > quelque soit le sujet !
> > Yahoo! Questions/Réponses pour partager vos connaissances,
> > vos opinions et vos expériences.
> > http://fr.answers.yahoo.com
> >
> >
> > 
> ---------------------------------------------------------------------
> > 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
> >
> 
> 
> This message is for the named person's use only. It may contain 
> confidential, proprietary or legally privileged information. No 
> confidentiality or privilege is waived or lost by any 
> mistransmission. If 
> you receive this message in error, please notify the sender 
> urgently and 
> then immediately delete the message and any copies of it from 
> your system. 
> Please also immediately destroy any hardcopies of the 
> message. You must not, 
> directly or indirectly, use, disclose, distribute, print, or 
> copy any part 
> of this message if you are not the intended recipient. The 
> sender's company 
> reserves the right to monitor all e-mail communications through their 
> networks. Any views expressed in this message are those of 
> the individual 
> sender, except where the message states otherwise and the sender is 
> authorised to state them to be the views of the sender's company.
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> 	
>  p4.vert.ukl.yahoo.com uncompressed Tue Aug 15 14:27:01 GMT 2006 
> 	
> 		
> ______________________________________________________________
> _____________ 
> Découvrez un nouveau moyen de poser toutes vos questions 
> quelque soit le sujet ! 
> Yahoo! Questions/Réponses pour partager vos connaissances, 
> vos opinions et vos expériences. 
> http://fr.answers.yahoo.com 
> 
> 
> ---------------------------------------------------------------------
> 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
>
 
 
This message is for the named person's use only. It may contain confidential, proprietary
or legally privileged information. No confidentiality or privilege is waived or lost by any
mistransmission. If you receive this message in error, please notify the sender urgently and
then immediately delete the message and any copies of it from your system. Please also immediately
destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail communications through their
networks. Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorised to state them to be the views of
the sender's company.

---------------------------------------------------------------------
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


Mime
View raw message