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] HTML Form instead of browser prompt for authentication?
Date Wed, 26 Jul 2006 13:03:49 GMT
> -----Original Message-----
> From: Peter Neu [mailto:peter.neu@gmx.net] 
> Sent: Wednesday, July 26, 2006 12:40 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] HTML Form instead of browser prompt 
> for authentication?
> 
> Hello,
> 
> I use the apache authentication with mod_auth_mysql. 
> Since I don't use php or cgi I get the ugly browser prompt 
> for user name
> and password. 
> 
> Is there a way to configure apache to simply use a HTML form for
> authentication? 

You need to understand *why* you get the "ugly browser prompt". It is
not apache that sends this, rather it is generated by the browser. Here
is the sequence of events:

- user requests resource in protected realm. Obviously, since this is a
first request, the user doesn't know that it's protected and so the
request does not contain any credentials.
- server receives request. There are no credentials, so browser sends
back 401 Unathorized.
- browser gets 401, so throws up ugly browser prompt to get creds from
user.
- browser caches creds and re-issues request, this time adding
credentials
- server gets request, checks creds, sends resource
- on all subsequent requests in same realm, browser automatically adds
creds.

So there is no way in this simple scheme to use a custom HTML page for
the login. The only way is to forget about basic auth and use
server-sided logic to control access using cookies (ie
session-handling). There are lots of ways; CGI, PHP, Cocoon, JSP, and
various modules such as posted by Aldrich.

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

> If yes, how is this done? (CGI and PHP are working)
> 
> I use apache 2.0.49.
> 
> Cheers,
> Pete
> 
> 
> 
> ---------------------------------------------------------------------
> 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