Author: bwells_core7 | Posted on: 8/6/2009 8:47:17 AM | Views : 391

Hi all,
I've been doing some research and testing with forms/role based authentication. I have code in my Global.asax's Application_AuthenticateRequest method that gets roles from a database based on a username and sets them to a GenericPrinciapl object:
if (Request.IsAuthenticated) { //Custom function: Get roles from the database and store it in an array of String. String[] arrRoles = GetRoles(User.Identity.Name); //Create a pricipal object, assign an identity (user and user properties), and the roles array related to that user. // This principal object will last the length of the request. GenericPrincipal principal = new GenericPrincipal(User.Identity, arrRoles); HttpContext.Current.User = new GenericPrincipal(User.Identity, arrRoles); }
One thing I don't understand is why this is d ...

Go to the complete details ...