問題描述
Why can't I bind my LDAP server in Perl code? (Why can't I bind my LDAP server in Perl code?)
I have found some problem with my ldap server, I just can't bind it with my perl script, and here is the script:
use strict;
use Net::LDAP;
my $ldap = "";
$ldap = Net::LDAP‑>new("iis.aulia.net");
my $mesg = "";
$mesg = $ldap‑>bind("CN=app‑audev‑adpead,OU=Applications,OU=Special,OU=Users
,OU=FRA,DC=iis,DC=aulia,DC=net", password => "=3\6dsdKDsH30z&B/'Bub00");
die $mesg‑>error() if $mesg‑>code();
$mesg = $ldap‑>unbind;
It always shows me :
80090308: LdapErr: DSID‑0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1 at search.pl line 16, line 522
Do I put a wrong combination after $mesg = $ldap‑>bind
? That "CN=app‑audev‑adpead"
is my ldap sever user login, and its written in the same format as that.
參考解法
方法 1:
With your error
80090308: LdapErr: DSID‑0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1 at search.pl line 16, line 522
The "data 52e" according to this page is "invalid credentials".
Possibly to do with you using \6
in a double quoted string, which will attempt to escape the six, instead of, as I imagine, represent a backslash and a six. So change it to:
password => q(=3\6dsdKDsH30z&B/'Bub00)
The single quote q()
will avoid interpolation, and you can change its delimiters to match whatever string you are quoting, for example q!foo(bar)!
.
You also have a line break in your bind string, which may or may not be significant.
As a side note: Should you really be posting your login information here?
(by user2186299、TLP)