|
Authen::DigestMD5 - SASL DIGEST-MD5 authentication |
Authen::DigestMD5 - SASL DIGEST-MD5 authentication (RFC2831)
use Authen::DigestMD5;
use OnLDAP; $ld=OnLDAP::Client->new($host); ($rc, $id)=$ld->sasl_bind(undef, 'DIGEST-MD5'); ($rc, $msg)=$ld->result($id); ($rc, $req)=$ld->parse_sasl_bind_result($msg);
print "IN: |$req|\n";
my $request=Authen::DigestMD5::Request->new($req);
my $response=Authen::DigestMD5::Response->new;
$response->got_request($request);
$response->set(username => $user,
realm => $realm,
'digest-uri' => "ldap/$host");
$response->add_digest(password=>$passwd);
my $res=$response->output;
print "OUT: |$res|\n";
($rc, $id)=$ld->sasl_bind(undef, 'DIGEST-MD5', $res); ($rc, $msg)=$ld->result($id); ($rc, $req)=$ld->parse_sasl_bind_result($msg);
$request->input($req); print $request->auth_ok ? "AUTH OK\n" : "AUTH FAILED\n"
This module supports DIGEST-MD5 SASL authentication as defined on RFC-2831.
This module implements three classes:
new(%props)%props. If $input is
passed it is parsed and the values obtained from it added to the
object.
input($input)$input and adds them to the
object.
output()set(%props)reset()auth_ok()got_request($req)$res object generated from
the request $req ones.
response property containing the MD5 digest to the
response object.
Be sure to look at the Authen::SASL manpage because it is very likely that it
is what you are looking for (Authen::DigestMD5 is only suitable
when you need a finer control over the authentication procedure).
SASL DIGEST-MD5 RFC http://www.ietf.org/rfc/rfc2831.txt.
Salvador Fandiņo, <sfandino@yahoo.com>
Copyright 2003 by Salvador Fandiņo.
Portions of this module have been copied from the the Authen::SASL manpage package by Graham Barr.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Authen::DigestMD5 - SASL DIGEST-MD5 authentication |