473,406 Members | 2,345 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,406 software developers and data experts.

Active Directory Login Page DN Format?

We are using forms authentication in our web app and typically query our LDAP
Servers by binding to the user node in the LDAP Tree.

We usually see the following DN used as the DN for each user..

http://serverip:389/cn=login,dc=company,dc=org
*where login is their actual windows login

In Active Directory we are seeing this format...
http://server:389/cn=firstname lastname,dc=company,dc=org
*where the cn attribute is their full name not their login

When we try to bind to the directory how should we bind if don't have the
full name from the login page? (ie we'd like to ask for a standard
username/password). The users are within their own OUs and apparently not
within the general cn=Users node too. Anyhow just wondering what format of a
DN might work other than the one above to locate a user within active
directory from an ASP.NET page. Thank you so much I really appreciate it!

Christopher

Nov 19 '05 #1
1 2931

When you're authenticating users, you don't care which container he's in; so
use serverless binding, e.g.

string domainAndUserName = userName + "@" + domain;
using (DirectoryEntry entry = new DirectoryEntry(null, domainAndUserName,
password, AuthenticationTypes.Secure))
{
try
{
// Bind to the native AdsObject to force authentication.
Object obj = entry.NativeObject;
}
catch (COMException ex) { // user unknown or password wrong or account
expired }
This will bind to the root of the AD and try to authenticate

Then you can use DirectorySearcher to find a user by its userName to test
various things, e.g. if the user's password expired, etc.

Here's a useful link:
http://msdn.microsoft.com/library/de...ng09102002.asp

"Christopher" <Ch*********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
We are using forms authentication in our web app and typically query our
LDAP
Servers by binding to the user node in the LDAP Tree.

We usually see the following DN used as the DN for each user..

http://serverip:389/cn=login,dc=company,dc=org
*where login is their actual windows login

In Active Directory we are seeing this format...
http://server:389/cn=firstname lastname,dc=company,dc=org
*where the cn attribute is their full name not their login

When we try to bind to the directory how should we bind if don't have the
full name from the login page? (ie we'd like to ask for a standard
username/password). The users are within their own OUs and apparently not
within the general cn=Users node too. Anyhow just wondering what format
of a
DN might work other than the one above to locate a user within active
directory from an ASP.NET page. Thank you so much I really appreciate it!

Christopher

Nov 19 '05 #2

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

Similar topics

1
by: anonymous | last post by:
Hi all, I've been searching the way to achieve the following task. But no luck so far. I have a web site(main site), which requires authentication. This authentication is set at Windows...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
0
by: newmem | last post by:
Hi We have web app running successfully on a windows 2000 server. Certain Admin pages have the authentication turned on and contains an admin web.config file which lists the user/groups in the...
3
by: Adrian Parker | last post by:
At the moment, we have a simple user id / password entry screen to login to our website, the data credentials are held in our database. We've now been asked to integrate with active directory so...
1
by: Raghu | last post by:
I have following code that validates a given user credentails against a active directory. The login part works but I can not search as it fails to return the record. Does any one have any idea...
1
by: sudeep347 | last post by:
Hi I am disgining a web based system in which i need to authenticate people according to the Active Directory login id or a separate databse for people not in Active directory domain. I am able to...
3
by: =?Utf-8?B?YXppZWdsZXI=?= | last post by:
Hello, everybody. I'd like to do this: For a big program (a web service) I need information about the usergroups an active-directory-user is member of. To be more precise, I need to know if a...
0
by: preeti13 | last post by:
Hi friends i am here again with my probelm. i have one login page when first login on the page it is checking the active directory user exist or not if user exist then go the next page all i nee to...
2
by: =?ISO-8859-1?Q?Bj=F6rn_K?= | last post by:
Hello Guys, i need to program an ASP.net Webapplication. This application should be only used by members of a specific group. So I want to write a Login-page like this: Username: Password: ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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,...
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.