473,763 Members | 6,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AD groups in ASP.NET project

Hello,

I am working at a ASP.NET project that uses
authenticate/authorize via Active Directory. There are
many groups with different roles.
I am unable to 'see' a solution for this kind of error :

- for a specific user X ( that belongs to group G1 and G2) this call :

DirectoryEntry. Invoke("Groups" )
returns an empty object.
- but if I try with my username to be member of the
same two groups G1 and G2 , the same method invocation

DirectoryEntry. Invoke("Groups" )
returns an object with 2 groups (G1 and G2).

Where is the error ? How can I debug to see the real error ?
It is an error of Active Directory/LDAP or in the ASP.NET or ....?

The user X is assumed to be the tester ... and I just
want to 'copy' his context and environment in order to fix it.
Thank you for your support,
DanielG
Nov 18 '05 #1
2 2911
Hi Daniel,

It is a much better idea to use the standard .NET IPrincipal object for
doing authorization in .NET applications. All of the .NET infrastructure
already supports this including ASP.NET. In fact, the WindowsPrincipa l
class that comes with the .NET Framework already knows how to calculate the
groups for a given user right out of the box. It's only limitation is that
it requires Windows authentication to initialize it.

It is also possible (but very much not recommended) to look up the groups
for a user and build your own custom IPrincipal class. In some cases this
may be necessary, such as when the web server is not a member of the domain
and there is no way to use Windows authentication. In that case, querying
AD for the user's tokenGroups object is an acceptable way to figure out what
groups a user is in.

If you do a Google groups search for tokenGroups, I believe you'll find lots
of sample code that shows you how to use this.

If you need more help on ASP.NET security in general, I'd suggest trying the
aspnet.security newsgroup as well.

Joe K.

"Daniel G" <da****@yahoo.c a> wrote in message
news:e6******** *************** ***@posting.goo gle.com...
Hello,

I am working at a ASP.NET project that uses
authenticate/authorize via Active Directory. There are
many groups with different roles.
I am unable to 'see' a solution for this kind of error :

- for a specific user X ( that belongs to group G1 and G2) this call :

DirectoryEntry. Invoke("Groups" )
returns an empty object.
- but if I try with my username to be member of the
same two groups G1 and G2 , the same method invocation

DirectoryEntry. Invoke("Groups" )
returns an object with 2 groups (G1 and G2).

Where is the error ? How can I debug to see the real error ?
It is an error of Active Directory/LDAP or in the ASP.NET or ....?

The user X is assumed to be the tester ... and I just
want to 'copy' his context and environment in order to fix it.
Thank you for your support,
DanielG

Nov 18 '05 #2


Hello,

Thank you for the response, and for the hint. ;-)

But, my problem is still alive. It is not about the
authorization/authenticate in the application.... but in Active
Directory database or hierarchy or ...
Why two users, members of the same 2 groups dont't see the same ASP.NET
page ?

Because in my case the execerpt of code showed :

DirectoryEntry. Invoke("Groups" )
or
the method via DirectoryEntry. RefreshCache(ne w string[]
{"TokenGroups"} );

is used in other area , to send an email ..and to fill a DropDownList
with these values (not authXYZ).

Where is the error in ASP or in AD and the rights of these two users to
read/write some objects in AD tree ?

How can I track what is happening behind this call :
Invoke ?

Thanks again for the support,
DanielG


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

21
11001
by: yer.lys | last post by:
When I print my web page the background image shrinks severly when I print from Firefox, but when I print in IE it cuts it like I would expect it to. Is this a bug or is there a mistake in my code somewhere? <--------------------------MY CODE-----------------------------> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">...
33
5641
by: Joerg Schuster | last post by:
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: <fl> get rid of this limitation! if p.pattern.groups > 100: raise AssertionError( "sorry, but this version only supports 100 named groups"
0
745
by: Do | last post by:
Hi, When I try to create or open an ASP.net web application (File-->Open Project From Web) using a regular user account, I cannot access the web application which is on a Windows 2003 Server. I have not customized any of the user accounts. Do I need to setup my development user
4
3536
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
0
3056
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The objective in utilizing this new deployment method is to reduce the maintenance overhead as well as making it easier for my users to setup and run the application initially. I have VS 2002, Windows XP, Access XP(2000 format). He is my problem....
3
1211
by: Darrel | last post by:
I noticed this nice new feature in 2.0: a.. Validation Groups - Validation groups allow multiple forms on a page to be separately validated. Alas, I'm using 1.1 on a project at the moment and need to do exactly that. Any best-method way to handle that with 1.1? I have one ASP.net form on the page, but two seperate sets of fields I want
3
925
by: Warex | last post by:
Hello, I am want to make a project using vb.net that works with news groups. Specifically go thru all directries, then all messages looking for key words in messages then displaying them on screen. I seem t not beable to google anything on working with newgroups in vb.net. then again maybe I am using the wrong keywords, Can anyone help point me in the right direction? Thanks, P.
0
2506
by: bcanter | last post by:
I found a file on the web that will allow you to enumerate groups but it was an .hta and the top level admins won't allow this. I need to give managers access to the groups so that when a new user is created they can tell me who they want their account to be modeled after. The html app works great as a .hta file but when it is saved as a web page it won't list the members of any groups. I get an error on line 182: "ActiveX component can't create...
0
1072
by: ysblokkie | last post by:
Hi Everybody, I am busy working on a web application project that uses Active Directory Distribution groups using C#. I want to use Microsoft Outlook to send emails to the AD groups, but I have a question: If I use Outlook to send the mail to the group, will the mail appear in the 'Sent' items of the sender, and wil the sender be able to receive read/received receipts for the mail? If this does not happen by default, how do I go...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.