Using this code for authentification:
HttpContext.Current.User=new GenericPrincipal
(new GenericIdentity(user.UserName), roles);
FormsAuthentication.SetAuthCookie(user.UserName,false);
Problem is - on next request, HttpContext.Current.User.IsAuthenticated
is true
, but HttpContext.Current.User.IsInRole("admin")
is false.
There are a lot of info on google but somehow nothing helps as usual.
Tried to add this to my web.config:
<system.web>
<roleManager enabled="false" />
</system.web>
I do not want to use membership provider.
Any tips?