| Authen-DigestMD5 documentation | view source | Contained in the Authen-DigestMD5 distribution. |
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:
base class implementing common methods to process SASL DIGEST-MD5 strings or objects:
create a new object with the properties in %props. If $input is
passed it is parsed and the values obtained from it added to the
object.
parses the properties on the string $input and adds them to the
object.
packs all the properties on the object as a string suitable for sending to a SASL DIGEST-MD5 server or client.
set object properties.
gets object properties.
clears public object properties. Some internal properties like nc counters are retained.
class to represent SASL DIGEST-MD5 requests as obtained from a server.
returns a true value if the request object contains a valid authentication token.
class to represent and generate SASL DIGEST-MD5 responses suitables for sending to a server.
adds certain properties to the response $res object generated from
the request $req ones.
adds the response property containing the MD5 digest to the
response object.
Be sure to look at Authen::SASL 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 Authen::SASL 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 documentation | view source | Contained in the Authen-DigestMD5 distribution. |