Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > LDAP path

Reply
Thread Tools

LDAP path

 
 
sck10
Guest
Posts: n/a
 
      04-15-2005
Hello,

I was given some code that was done in ColdFusion, and I am trying to figure
out how to map the LDAP path. Any help would be appreciated.

This is what I got from the Microsoft web site
// Path to you LDAP directory server.
string adPath = "LDAP://yourCompanyName.com/DC=yourCompanyName,DC=com";
LdapAuthentication adAuth = new LdapAuthentication(adPath);

This is the code snippet that I got fro ColdFusion
-------------------------------------------------
<cfldap action="QUERY"
name="empquery_login"
attributes="employeenumber,roomnumber,sname"
start="ou=people, o=lucent.com"
filter="(employeenumber=#ssno#)"
scope="onelevel"
server="ldap-useast.train.com"
port="389">

--
Thanks in advance,

sck10


 
Reply With Quote
 
 
 
 
Peter Huang [MSFT]
Guest
Posts: n/a
 
      04-16-2005
Hi,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.


Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
Joe Kaplan \(MVP - ADSI\)
Guest
Posts: n/a
 
      04-16-2005
I'm not sure what "LdapAuthentication" is here, but if that is an MS sample,
there is a good chance that it is AD-specific and should not be used.

What are you trying to do here, authenticate a user to an LDAP directory or
just look up some attribute values from their user object in the LDAP store?

Given that the example below is a simple search, I'll assume the latter. In
that case, you would want to try to use the DirectorySearcher with something
like this:

//air code, may not compile
DirectoryEntry root = new
DirectoryEntry("LDAP://ldap-useast.train.com/ou=people, o=lucent.com", "",
"", AuthenticationTypes.None);
DirectorySearcher searcher = new DirectorySearcher(root);
searcher.SearchScope = SearchScope.OneLevel;
searcher.PropertiesToLoad.AddRange(new string[] {"employeenumber",
"roomnumber", "sname"});
searcher.Filter = String.Format("(employeenumber={0})", empNum); //you
provide that parameter...
SearchResult result = searcher.FindOne();
//then retrieve the values from the result.Properties collection

The trick here will be in providing the correct credentials and
authentication types to work with your directory. In the example above, I
provided a null user and password, but that might not be right. Using
AuthenticationTypes.Anonymous may also be correct.

The other thing to watch out for would be schema mapping issues. ADSI/S.DS
is notorious for struggling to parse the schema of third-party LDAP
directories, so if you get weird "cannot convert datatype" errors, that is
the problem. In that case, you might not be able to get this to work with
S.DS and might need to wait for .NET 2.0 and
System.DirectoryServices.Protocols.

HTH,

Joe K.

"sck10" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I was given some code that was done in ColdFusion, and I am trying to
> figure
> out how to map the LDAP path. Any help would be appreciated.
>
> This is what I got from the Microsoft web site
> // Path to you LDAP directory server.
> string adPath = "LDAP://yourCompanyName.com/DC=yourCompanyName,DC=com";
> LdapAuthentication adAuth = new LdapAuthentication(adPath);
>
> This is the code snippet that I got fro ColdFusion
> -------------------------------------------------
> <cfldap action="QUERY"
> name="empquery_login"
> attributes="employeenumber,roomnumber,sname"
> start="ou=people, o=lucent.com"
> filter="(employeenumber=#ssno#)"
> scope="onelevel"
> server="ldap-useast.train.com"
> port="389">
>
> --
> Thanks in advance,
>
> sck10
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
python-ldap/win32 or python/ldap/win32 rcmn Python 1 11-06-2006 11:47 PM
Need to wrtie LDAP class to *answer* LDAP queries. junk1@davidbevan.co.uk Java 1 02-21-2006 09:59 PM
ruby-ldap: uninitialized constant LDAP::LDAP_CONTROL_PAGEDRESULTS James Hughes Ruby 4 12-13-2005 11:46 PM
[ANN] Ruby/LDAP 0.9.1: LDAP API (RFC1823) library. Ian Macdonald Ruby 0 03-15-2005 11:23 PM
using LDAP Controls in ruby-ldap Jason Wold Ruby 5 11-07-2004 03:35 AM



Advertisments