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

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
 
U

Ufit

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

Uf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top