Authentication prosessen
Global.asax
beskyttet void Application_AuthenticateRequest (Object avsenderen, EventArgs e)
{
if (HttpContext .Current.User! = null)
{
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
if (HttpContext. Current.User.
Identity er FormsIdentity)
{
FormsIdentity id = (FormsIdentity) HttpContext.Current.User.Identity;
FormsAuthenticationTicket billett = id.Ticket;
//Få de lagrede bruker-data, i dette tilfellet, våre roller
string Userdata = ticket.UserData;
String [] roller = userData.Split (',' );
HttpContext.Current.User = nye System.Security.Principal.GenericPrincipal (id, roller);
}
}
}
}
Web.config (Admin mappe) (sikre tilgang)
.
web>
= "admin">
= "user">
= "">
Web.config (Root-fil)
= "user>
=" user>
.web>
= "*">
= "user>
.web>
=" * ">
= "user>
.web>
=" * ">
=" user>
.web>
= "*">
= "admin>
.web>
=" * ">
=" adminimages ">
.web>
= "*">
= "bilder">
.web>
= "*" >
= "app_themes">
.web>
= "*">
Login.ascx
Ticket skapelse, cookie legge etc.
Mail logikk, SMS logikk
Krypter, dekryptere kode
= "admin>
=" user>
= "user>
=" user>