I've got a WSS3 sharepoint site that requires windows authentication both in IIS and via the Sharepoint site. What I would like to do is in the case that a user does not provide valid AD credentials they are redirected to a custom error page.
This isn't forms-based authentication. They are challenged. In IE if I cancel I see a generic "401 UNAUTHORIZED" plain text response. If I attempt a log in then cancel I see a blank page.
I have looked into several options such as customErrors, httpModule interception (only saw examples for this after the user is authenticated or when anonymous access is allowed via IIS), IIS Url rewrites (didn't see how this could help).
[UPDATE] This article fixes the arrive then immediately cancelled when using the "Log on as a different user" option from within Sharepoint, but not when credentials are provided that are invalid, then cancelled or when hitting Sharepoint freshly and providing credentials:
Redirecting to custom 401 page when "Access denied" occures within an ASP.NET application with Windows authentication