[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Trouble with Authenticating...

What does your ldap_init line look like? Are you checking for problems there?

Try also using <x-tad-bigger>ldap_perror() </x-tad-bigger>to print you error. I think sometimes it gives a little bit more detailed information.

Run your server with -d 256 and look at the output when your code is run. This might give a further clue as to what is wrong.

On Jun 9, 2004, at 11:20 PM, Ben Bargabus wrote:

Continuing to troubleshoot...

I can connect properly with ldapsearch so as the previous poster
mentioned the problem is likely in my code.

I inserted a new line in my program to return the error message
associated with my failed bind operation, the new code now reads as

if ((result = ldap_simple_bind_s(ld, "CN=Bob", "password")) !=
printf("Unable to bind to server.\n");
printf("LDAP Returned: %s\n", ldap_err2string(result));

when run generates...

% ./ldaptest
Unable to bind to server.
LDAP Returned: Can't contact LDAP server

When I ran with ldapsearch I did as follows...

% ./ldapsearch -D "CN=Bob" -W "CN=Bob"
Enter LDAP Password: password

# extended LDIF
# LDAPv3
# base <> with scope sub
# filter: CN=Bob
# requesting: ALL

# Bob
dn: CN=Bob
cn: Bob
postaladdress: USA
homepostaladdress: USA
companyname: co
department: co
c: USA
objectclass: dominoPerson
objectclass: inetOrgPerson
objectclass: organizationalPerson
objectclass: person
objectclass: top
mailsystem: 100
messagestorage: 1


Anyone have further ideas?
Thanks again,