Talk About Network

Google





Software > ADSI General > Re: eDirectory ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 9 Topic 5354 of 5437
Post > Topic >>

Re: eDirectory Authentication in .net

by =?Utf-8?B?bmVsc29uYWQ=?= <nelsonad@[EMAIL PROTECTED] > Aug 6, 2008 at 01:31 PM

That makes sense, I just dont know how to work with certificates i guess.
But 
hopefully our customers trying to integrate LDAP authentication with our 
application will....I guess I need to provide configuration options for
using 
SSL, the LDAP Search Root, and the Server Context

My authentication code is as follows: using S.DS.P objects

LdapConnection con = new LdapConnection(new 
LdapDirectoryIdentifier(this.SearchRoot), new 
System.Net.NetworkCredential(string.Empty, string.Empty), AuthType.Basic);
con.SessionOptions.SecureSocketLayer = this.UseSSL;
using (con)
{
      con.Bind();
      SearchRequest request = new SearchRequest("o=" + this.Context,
"(uid=" 
+    this.tbUserName.Text + ")",  
System.DirectoryServices.Protocols.SearchScope.Subtree);

      SearchResponse response = (SearchResponse)con.SendRequest(request);
      SearchResultEntry entry = response.Entries[0];
      string dn = entry.DistinguishedName;
      con.Credential = new NetworkCredential(dn, this.tbPassword.Text);
      con.Bind();
}

in local testing i also have a line 
con.SessionOptions.VerifyServerCertificate = new 
VerifyServerCertificateCallback(ServerCallback);

which simply returns true because i cant seem to get my certificates 
validated.


"Lance R" wrote:

> On Aug 6, 1:23 pm, nelsonad <nelso...@[EMAIL PROTECTED]
>
> wrote:
> > I figured out that i was using the wrong value for ldap-server...i had
been
> > trying servername-nds but it should just be servername, so then i ran
the
> > query and got an exception of: server certificate verification failed.
> > Connection aborted.
> 
> Yep, I can help with this.
> 
> In order to be the most secure, the component can't just accept any
> old SSL certificate unless one of the following is true:
> 
> 1.  The server machine automatically trusts it (the cert issuers
> public key is installed in the trusted root certificate store)
> 
> 2.  You tell it to accept it by setting the SSLAcceptServerCert
> property before attempting to connect.  If initially you don't have
> such a setting, the component will provide the server certificate to
> you for your inspection in the SSLServerCert property when you attempt
> to bind.  If you trust this certificate, you can then set the
> SSLAcceptServerCert to this same certificate before making future
> requests.
> 
> 3.  If you're using the SSLServerAuthentication event, you can inspect
> the server certificate right there, and set the Accept parameter to
> true to go ahead and accept the certificate and continue with the
> connection.
> 
> Lance
> http://www.lancerobinson.net/
> 
>
 




 9 Posts in Topic:
eDirectory Authentication in .net
=?Utf-8?B?bmVsc29uYWQ=?=   2008-08-05 10:48:01 
Re: eDirectory Authentication in .net
"Joe Kaplan" &l  2008-08-05 15:19:41 
Re: eDirectory Authentication in .net
=?Utf-8?B?bmVsc29uYWQ=?=   2008-08-05 16:16:01 
Re: eDirectory Authentication in .net
"Joe Kaplan" &l  2008-08-05 20:33:04 
Re: eDirectory Authentication in .net
Lance R <lmrobins@[EMA  2008-08-06 08:37:44 
Re: eDirectory Authentication in .net
=?Utf-8?B?bmVsc29uYWQ=?=   2008-08-06 10:23:01 
Re: eDirectory Authentication in .net
Lance R <lmrobins@[EMA  2008-08-06 11:06:05 
Re: eDirectory Authentication in .net
=?Utf-8?B?bmVsc29uYWQ=?=   2008-08-06 13:31:00 
Re: eDirectory Authentication in .net
"Joe Kaplan" &l  2008-08-06 17:29:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Thu Jan 8 21:10:56 PST 2009.