Hadmut Danisch wrote:
how would I generate a web page (i.e. a login form) from a authen handler in the case that the user is not authenticated yet ? Can the authen handler generate HTML code and pass it back to the client as an immediate reply?
The authen handler can simply return the right status code - eg. login failed, OK, declined etc
The response phase can then do something special with it - I have sites on which the front page ( / ) has the login form, and in httpd.conf I do:
<VirtualHost> ErrorDocument 401 / </VirtualHost>this means if my authen handler returns failed, the ErrorDocument directive will do an internal redirect to the page / which contains the login form. The status code returned to the browser is still 401, which is great because it tells the browser that the user/pass was invalid and therefore not to remember it. For added karma, the login page detects wether it's a 401 and if so, displays the 'login failed' message.
cheers John
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.