G
Guest
Hello!
I have a strange problem with .IsInRole method. When I use this method on my
development machine everything works fine. However when I deploy my
application on a production server this method does not work correct.
I use the following code:
String DefaultAdminRole = @"dom\admgroup";
String UserName="";
WindowsPrincipal AuthenticatedUser = User as WindowsPrincipal;
if (null!=AuthenticatedUser)
{
UserName = AuthenticatedUser.Identity.Name;
if (!AuthenticatedUser.IsInRole(@"dom\admgroup")){
Response.Write("You do not have permissions!");
}
else
{
Response.Write("You have permissions");
}
IsInRole is always false on production server, no matter who user is...
My development machine is Windows XP with IIS 5.1
Production server is Windows 2000 with IIS 5.0
The Authentication settings in IIS on both machines are excatly the same
(Windows Ingegrated Authentication).
Please, could anyone advice me, what could be wrong? Your help is very much
appreciated!
Thanks!
Peter
I have a strange problem with .IsInRole method. When I use this method on my
development machine everything works fine. However when I deploy my
application on a production server this method does not work correct.
I use the following code:
String DefaultAdminRole = @"dom\admgroup";
String UserName="";
WindowsPrincipal AuthenticatedUser = User as WindowsPrincipal;
if (null!=AuthenticatedUser)
{
UserName = AuthenticatedUser.Identity.Name;
if (!AuthenticatedUser.IsInRole(@"dom\admgroup")){
Response.Write("You do not have permissions!");
}
else
{
Response.Write("You have permissions");
}
IsInRole is always false on production server, no matter who user is...
My development machine is Windows XP with IIS 5.1
Production server is Windows 2000 with IIS 5.0
The Authentication settings in IIS on both machines are excatly the same
(Windows Ingegrated Authentication).
Please, could anyone advice me, what could be wrong? Your help is very much
appreciated!
Thanks!
Peter