472,374 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 1282

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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.