473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

problem with .IsInRole

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
Nov 19 '05 #1
0 993

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kevin | last post by:
Hello all, I'm unable to get the IsInRole method to work with my AD domain. There is a global group that I am a member of, when I query that group using the IsInRole method, it returns false. ...
6
by: JIM.H. | last post by:
Hello, username=user.identity.name trueFalse=User.IsInRole("myDomain\Administrators")? First line return user name as administrator but second line returns false? What might be the reason? Or how...
5
by: arjun | last post by:
Hi All, I am developing a A webpage to be seen in a page viewer webpart(Sharepoint 2003). The page is supposed to check for the current user name and then check the user membership in some local...
4
by: Jeff B | last post by:
I am having a very perplexing problem with setting the user's roles. I have tried to figure this out for 2 days now. When the user logs in to the site, I retrieve the roles from the database and...
2
by: Dave | last post by:
Hi, I'm testing the IsInRole method on my app. I'm using Integrated security so I'm not sure if that has something to do with it. I have a groups table which I want to secure certain portions...
1
by: Michael Persaud | last post by:
Hi All, I am trying to get role based authentication and its not working I have set IIS to windows and removed anonymous the config file has identity impersonate=true winows authen my...
10
by: Bob | last post by:
This a bit of a second post on same subject, my apologies. IsinRole function only works with built-in roles. If I create a new group on my domain controller then add an existing user to that...
7
by: sunil | last post by:
Hi, I have created a setup project which installs a Network service. In the installer, I had to set some security permissions so that Network service can access my installation folder. Since, only...
0
by: ronscottlangham | last post by:
I have a web page that any authenticated user can access, but I dynamically enable/disable other asp.net controls on the web page based on the Role that they are in via C# code behind. My web...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.