Re: How to authenticate to iPlanet server using LDAPS?

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 10/19/05


Date: Wed, 19 Oct 2005 09:23:32 -0500

You need to be using AuthenticationTypes.SecureSocketsLayer. If that
doesn't work, there is probably an issue with the local LDAP client
accepting the certificate from the server. There are 3 main reasons this
fail:
 - The DNS name in your binding string doesn't match the DNS name in the
cert
 - The cert is expired or not yet valid
 - The local client does not trust the server's certificate

Essentially, these are the same reasons you get a certificate warning dialog
in IE, except that LDAP always fails on these conditions.

The System event log may also contain errors from Schannel that tell you
what the problem was. If not, you can also bump up the logging level:
http://support.microsoft.com/?id=260729

Since you are using .NET 2.0 also, you might consider using
System.DirectoryServices.Protocols for this purpose. It is lower level and
has the benefit of eliminating all of the ADSI layer from the LDAP calls.

Joe K.

<JohnnyO''''Clock@community.nospam> wrote in message
news:6DA34789-33FB-4246-B473-E456ECE2FECD@microsoft.com...
> I've been trying to build an LDAP provider in ASP.Net 2.0. I know the
> basic
> steps are to search the directory for user object, grab the full user
> object
> context and bind to it securely, and then attempt to authenticate by
> sending
> the username and password. I can't find any documentation on using LDAPS
> for
> authenticating to a non-microsoft ldap server. Here's a console code
> snippet
> I've been using which works and enumerates a user's properties:
>
> using System;
> using System.Collections.Generic;
> using System.Text;
> using System.DirectoryServices;
>
> namespace iPlanet
> {
> class Program
> {
>
>
> static void Main(string[] args)
> {
> string adsPath = "LDAP://ldap.school.edu/dc=school,dc=edu";
>
> //Explicitly create our SearchRoot
> DirectoryEntry searchRoot = new DirectoryEntry(
> adsPath,
> null,
> null,
> AuthenticationTypes.None
> );
> //AuthenticationTypes.None - works
> //AuthenticationTypes.Anonymous - doesn't work
> //AuthenticationTypes.Secure - doesn't work
> //AuthenticationTypes.SecureSocketsLayer - doesn't work
> //AuthenticationTypes.Encryption - doesn't work
> //AuthenticationTypes.ReadonlyServer - works
> //AuthenticationTypes.ServerBind - works
> //AuthenticationTypes.Signing - works
> //AuthenticationTypes.Sealing - works
> //AuthenticationTypes.FastBind - works
> //AuthenticationTypes.Delegation - works
>
> using (searchRoot)
> {
> DirectorySearcher ds = new DirectorySearcher(
> searchRoot,
> "(uid=jdoe)" //user being searched for
> );
>
> using (SearchResultCollection src = ds.FindAll())
> {
> //Console.WriteLine("Returning {0}", src.Count);
>
> foreach (SearchResult sr in src)
> {
> foreach (string prop in
> sr.Properties.PropertyNames)
> {
> foreach (object o in sr.Properties[prop])
> {
> Console.WriteLine("{0}: {1}", prop, o);
> }
> }
> }
> }
> }
> }
> }
> }
>
> The problem I have is when I've tried to bind to the LDAP server. It
> errors
> out with the message that the server may not be operational. What the
> correct
> authentication type for an iPlanet ldao server?
>



Relevant Pages

  • Re: Does samba 3.0.14Aa on OS 5.0.6 work with ldapsam backend on another LDAP server?
    ... used 3.0.9 on SCO 5.0.6 for quite some time after suffering problems I ... a RedHat4 box running samba 3.0.10 and OpenLDAP 2.2.13. ... and no LDAP server (although there were the ... share on the SCO server without any smbpasswd on that server! ...
    (comp.unix.sco.misc)
  • Re: asp.net and ldap
    ... The application's ldap requery code works well on your development ... however you're encoutering "the server is not operational" error ... If so, based on my experience, this should be a certificate related ... > Computer Certificate Store's Trusted root CA to see whether you can find ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: asp.net and ldap
    ... The application's ldap requery code works well on your development ... however you're encoutering "the server is not operational" error ... If so, based on my experience, this should be a certificate related ... Computer Certificate Store's Trusted root CA to see whether you can find ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: LDAP & Find People not working
    ... need to refer to the KB article below to know how to use LDAP: ... | Yes, the scanner is on the local area network, so as you indicated below, ... | So I wonder why the scanner does not see the LDAP server. ...
    (microsoft.public.windows.server.sbs)
  • slapd - slow starting
    ... contact LDAP server ... then slapd started fine but I without ldap in nsswitch.conf I cant ... # The user ID attribute (defaults to uid) ... # SSL enabled. ...
    (freebsd-stable)