开发者

Connect to Sun LDAP with ADO

I want to connect (and get user's group) to a Sun LDAP server with a Delphi program. I think ADSI works only with Microsoft LDAP. I try it with ADO, but I can't connect.

Can someone sho开发者_运维百科w some code how I would do this?


I think this code will fit the bill.

There is more to ADSI than just LDAP, and from my experience it is easier to use LDAP client to connect to ActiveDirectory than the other way around - which is what you are trying to do, unfortunatly.

To get you started, here is a fail safe way to authenticate a user.

  1. Establish a connection with your LDAP server with your service account. If possible, use the LDAP protocol over SSL, LDAPS
  2. Search for the username (wich is the CN=jdoe part) to get the full DN (distinguished name)
  3. If you have duplicate result, stop here with an error
  4. Bind to the LDAP with the DN and password you are trying to validate. Make shure you are using the same validation method on both side.
  5. If it binds, the password is valid.
  6. Close the connection you just established
  7. Depending on your needs, either hold on to the connection you made a step 1 or tear it down, too.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜