I'm making the assumption that you're using windows Authentication for
your web application.
I would recommend doing this security check in the Application's
AuthorizeRequest event. You can set the domain in an appSetting in your
web.config file. The following code is untested:
Web.config:
<configuration>
<appSettings>
<add key="AuthorizedDomainName" value="Watusi" />
</appSettings>
<system.web>
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
</system.web>
<location path="notauthorized.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
</configuration>
global.asax
void Application_AuthorizeRequest(object sender, EventArgs e)
{
if
(!User.Identity.Name.StartsWith(ConfigurationSetti ngs.AppSettings["AuthorizedDomainName"]
+ "\\")) HttpContext.Current.Response.Redirect("notauthoriz ed.aspx");
}
-Alan
Carlos wrote:
Hi all,
is it possible to configute an asp .net app using web config, to allow
access to users within a particular domain only?.
Any help is greatly appreciated.
Thanks in advance,
Carlos