Forms auth. - User.IsInRole() - doesn't work

  • Thread starter Thread starter Ufit
  • Start date Start date
U

Ufit

I put the code from msdn that assigns the roles to user using Security and FormsAuthentcation
classes and place in Global.asax AuthenticateRequest() - getting from decrypted cookie.
Code is from f.ex http://support.microsoft.com/kb/308157
After creating a new identity (Global.asax)
HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id, myRoles);
on my other page the following code gives me false
User.IsInRole(".....")
The same line returns true in Global.asax so it should work on other page
but it doesn't. Why?
All is coded fine but I suspect something might be set wrong in Web.config.
Anyone could help and suggest how to solve that issue?
I use VS 2005 WAP model.
Big thanks.

Uf
 
Never mind - problem solved. Just disable the roles in ASP.NET configuration
and all works fine.)

Uf
 
Back
Top