J
Jacob Pallapati
I am trying to bind to an Active Directory server using ldap_bind. I
am initializing the SEC_WINNT_AUTH_IDENTITY structure with the user
name, passwd and domain name, and then pass it to ldap_bind as the
third parameter. It works fine except for the fact that the domain
name seems to be ignored. The bind succeeds no matter what I pass in
for the domain, as long as the user name and password are correct.
Here is an outline of my code:
secIdent.User = (unsigned char*)loginName;
secIdent.UserLength = strlen(loginName);
secIdent.Password = (unsigned char*)adPasswd;
secIdent.PasswordLength = strlen(adPasswd);
secIdent.Domain = (unsigned char*)domainName;
secIdent.DomainLength = strlen(domainName);
secIdent.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
//status = ldap_simple_bind_s(ld, loginName,
(PCHAR)authData->password);
status = ldap_bind_s(ld, NULL, (PCHAR)&secIdent, LDAP_AUTH_NTLM);
Am I missing some thing? I tried LDAP_AUTH_NTLM, LDAP_AUTH_NEGOTIATE
and LDAP_AUTH_DIGEST. The bind failed when using the LDAP_AUTH_DIGEST
mode. Any inputs on this will be appreciated.
Thanks,
Jacob
am initializing the SEC_WINNT_AUTH_IDENTITY structure with the user
name, passwd and domain name, and then pass it to ldap_bind as the
third parameter. It works fine except for the fact that the domain
name seems to be ignored. The bind succeeds no matter what I pass in
for the domain, as long as the user name and password are correct.
Here is an outline of my code:
secIdent.User = (unsigned char*)loginName;
secIdent.UserLength = strlen(loginName);
secIdent.Password = (unsigned char*)adPasswd;
secIdent.PasswordLength = strlen(adPasswd);
secIdent.Domain = (unsigned char*)domainName;
secIdent.DomainLength = strlen(domainName);
secIdent.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
//status = ldap_simple_bind_s(ld, loginName,
(PCHAR)authData->password);
status = ldap_bind_s(ld, NULL, (PCHAR)&secIdent, LDAP_AUTH_NTLM);
Am I missing some thing? I tried LDAP_AUTH_NTLM, LDAP_AUTH_NEGOTIATE
and LDAP_AUTH_DIGEST. The bind failed when using the LDAP_AUTH_DIGEST
mode. Any inputs on this will be appreciated.
Thanks,
Jacob