I have implemented a custom UrlAuthorization module as shown here
The code is as follows:
public class CustomUrlAuthorizationModule : IHttpModule
{
public void Init(HttpApplication context)
{
context.AuthorizeRequest += new EventHandler(context_AuthorizeRequest);
}
void context_AuthorizeRequest(object sender, EventArgs e)
{
HttpApplication context = (HttpApplication)sender;
if (context.User != null && context.User.Identity.IsAuthenticated)
{
HttpContext _httpContext = context.Context;
SiteMapNode node = SiteMap.Provider.FindSiteMapNode(_httpContext);
if (node == null)
throw new UnauthorizedAccessException();
}
}
public void Dispose()
{
}
}
My question is, do I have to call init from within every single one of my pages on load or is there a way to set IIS to do it automatically with every load.
This question is probably very dumb....