I have a web app that is served with Lighttpd. I implemented digest authentication to the application using its Lighttpd’s mod_auth module: https://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_auth
Currently it displays a blank white page when user is prompted for username and password. I’d like to be able to customize this page and redirect to the web app once user has logged in successfully. Is this possible?
2
Answers
"it" is the client, often a browser, which handles the 401 Unauthorized response from the server.
If you want to manage the authorization yourself instead of letting the browser do it, then you can write a FastCGI Authorizer and can implement HTTP Digest Auth yourself. Detect if the client is authorized, if not serve a web page of your choice (or redirect) which prompts for username and password, along with some token for the target page once the user fills out the form and is authorized. See lighttpd mod_fastcgi
For authentication create a html page and specify its location in Lighttpd’s configuration. After authentication use
mod_redirect
, by which you can setup redirect to your web app.