I have an intranet app where I am allowing access to certain pages based on the department the user belongs. Works fine in debug mode, but when I deploy to my local IIS, my code does not work properly.
I am using
var User = System.Web.HttpContext.Current.User;
var wi = new WindowsTokenRoleProvider();
if (wi.IsUserInRole(User.Identity.Name, "Domain\\RSExecutive").ToString().ToLower() == "true")
Works fine debugging. I get a value of True as expected. Once I publish, I get False, which is incorrect.. Windows Authentication mode, impersonation set to true, and Role provider is AspNetWindowsTokenRoleProv
This is a 2010 environment and in 4.0
Thanks in advance.