November 2015
Intermediate to advanced
152 pages
2h 46m
English
We just saw how to enable basic authentication with IIS. However, if the website is a publically available website, it is not possible to authenticate the user using Windows credentials. In such cases, the website should authenticate using the ASP.NET membership provider. In order to achieve this, we need to implement a custom membership with basic authentication.
Custom membership with basic authentication can be implemented using an HTTP module as given in the following:
public class BasicAuthHttpModule : IHttpModule
{
//...
}We need to create two methods and hook them to the AuthenticateRequest and EndRequest events in the Init method as given in the following code:
public void Init(HttpApplication context) ...
Read now
Unlock full access