473,394 Members | 1,735 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,394 software developers and data experts.

Problem with Role Base Security (IsInRole)

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.

One question that I had, is there anything different that has to be done
with AD when using this method? For example, I'm populating a list box with
the members of this group, and when I attach using LDAP I had to use
"LDAP://server.domain.com/CN=Group,DC=domain,DC=com" to attach.

I noticed that when I got the current identity, the user name was in
pre-Win2K form @"Domain\Kevin" so to determine role, I used
(IsInRole(@"Domain\Group") which does not work. Is there another form this
needs to take? Also, the group name has spaces in it, could that be part of
the problem?

I'm including a code snippet below, please let me know if anyone has any
ideas.
Thanks
Kevin

WindowsIdentity wiUserID = WindowsIdentity.GetCurrent();
WindowsPrincipal wpPrincipal = new WindowsPrincipal(wiUserID);
if(wpPrincipal.IsInRole(@"Domain\Default Title Curative"))
{
MessageBox.Show("It worked","OK",MessageBoxButtons.OK);
}
else
{
MessageBox.Show("Error","Wrong",MessageBoxButtons. OK);
}
Nov 15 '05 #1
0 1340

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

Similar topics

0
by: Chris | last post by:
Hi, Regarding : Role based Security Scenario : On W2K, I'm currently logged in as 'user1' Checking the properties of the user account 'user1' : --> Start/Programs/Administrative...
2
by: MJB | last post by:
I know I can get the current username through the System.Environment class, but I can't seem to find where I can retrieve the user's role / permission level (i.e. Admin, power user, etc). If...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
1
by: Mike Logan | last post by:
Questions about Role Based Security in ASP.Net: I have a few questions about role based security in an ASP.Net application. Below are some points about our system: - We have a hierarchical...
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...
8
by: Mark White | last post by:
Hey everyone I'm having a great deal of problems finding this information through google and yahoo, so I turn to you on this. I have a Windows app running on XP. I am able to caputre the...
1
by: =?Utf-8?B?RjVGNUY1?= | last post by:
I use the following function to ascertain if the current user is in ann AD security group. It appears to work, except if the group contains any space characters, it always returns false. For...
2
by: Khafancoder | last post by:
Hi , i'm developing a permission-based win application there is one Permission for each possible Action in db & each Role has some Permissions and a custom authentication system is implemented...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.