I am trying to connect a LDAP server. Customer sent following 3 info to me:
- IP address of LDAP server
- username
- password
I am using following code:
my $ldap = Net::LDAP->new ($ip_address) or die "$@";
my $mesg = $ldap->bind ( $username,
password => $password,
) or die $@;
my $result = $ldap->search(
base => $base,
filter => $filter
attrs => \@attributes,
);
die $result->error if $result->code;
$result->error value is :
'000004DC: LdapErr: DSID-0C090728, comment: In order to perform this operation a successful bind must be completed on the connection.,
According to message, bind is not successful. But it should die if it was unsuccessful. I changed password, wrote wrong value, it again did not die.
I dumped $mesg which is return value of bind and saw following message:
'80090308: LdapErr: DSID-0C0903C5, comment: AcceptSecurityContext error
But it is same with the correct username and password too. Username is 'itservice'. I am using as follow:
my $mesg = $ldap->bind ( 'itservice',
password => $password,
) or die $@;
I tried as follow but result is same
my $mesg = $ldap->bind ( 'cn=itservice',
password => $password,
) or die $@;
Is there any other format of using username or password?
ldapsearch
query from the command line? – xxfelixxx52e
. Maybe your credentials are wrong...ask your client to validate the credentials and give you an example ldapsearch that should work. – xxfelixxx