64 |
# warn "## upstream = ",dump( $self->{upstream} ); |
# warn "## upstream = ",dump( $self->{upstream} ); |
65 |
# warn "upstream not Net::LDAP but ",ref($self->{upstream}) unless ref($self->{upstream}) eq 'Net::LDAP'; |
# warn "upstream not Net::LDAP but ",ref($self->{upstream}) unless ref($self->{upstream}) eq 'Net::LDAP'; |
66 |
|
|
67 |
|
my $msg; |
68 |
|
|
69 |
|
# FIXME we would need to unbind because A3C::LDAP binds us automatically, but that doesn't really work |
70 |
|
#$msg = $self->{upstream}->unbind; |
71 |
|
#warn "# unbind msg = ",dump( $msg ); |
72 |
|
|
73 |
|
$msg = $self->{upstream}->bind( |
74 |
|
dn => $req->{name}, |
75 |
|
password => $req->{authentication}->{simple} |
76 |
|
); |
77 |
|
|
78 |
|
warn "# bind msg = ",dump( $msg ); |
79 |
|
if ( $msg->code != LDAP_SUCCESS ) { |
80 |
|
warn "ERROR: ", $msg->code, ": ", $msg->server_error, "\n"; |
81 |
|
return { |
82 |
|
matchedDN => '', |
83 |
|
errorMessage => $msg->server_error, |
84 |
|
resultCode => $msg->code, |
85 |
|
}; |
86 |
|
} |
87 |
|
|
88 |
return RESULT_OK; |
return RESULT_OK; |
89 |
} |
} |
90 |
|
|