NAME
Authen::SASL - SASL Authentication framework
SYNOPSIS
use Authen::SASL;
$sasl = Authen::SASL->new(
mechanism => 'CRAM-MD5 PLAIN ANONYMOUS',
callback => {
pass => \&fetch_password,
user => $user,
}
);
DESCRIPTION
SASL is a generic mechanism for authentication used by several network protocols. Authen::SASL provides an implementation framework that all protocols should be able to share.
The framework allows different implementations of the connection class to be plugged in. At the time of writing there were two such plugins.
- Authen::SASL::Perl
-
This module implements several mechanisms and is implemented entirely in Perl.
- Authen::SASL::Cyrus
-
This module uses the cyrus V1 C library.
CONTRUCTOR
The contructor may be called with or without arguments. Passing arguments is just a short cut to calling the mechanism
and callback
methods.
METHODS
- mechanism
-
Returns the current list of mechanisms
- mechanism NAMES
-
Set the list of mechanisms to choose from. NAMES should be a space separated string of the names.
- callback NAME
-
Returns the current callback associated with NAME
- callback NAME => VALUE, NAME => VALUE, ...
-
Sets the given callbacks to the given values
- client_new SERVICE, HOST, SECURITY
-
Creates and returns a new connection object.
The Connection Class
- client_start
-
The initial step to be performed. Returns the initial value to pass to the server or an empty list on error.
- client_step CHALLENGE
-
This method is called when a response from the server requires it. CHALLENGE is the value from the server. Returns the next value to pass to the server or an empty list on error.
- property NAME
- property NAME => VALUE, NAME => VALUE
- service
-
Returns the service argument that was passed to
client_new
- host
-
Returns the host argument that was passed to
client_new
- mechanism
-
Returns the name of the chosen mechanism.
Callbacks
There are three different ways in which a callback may be passed
- CODEREF
-
If the value passed is a code reference then, when needed, it will be called and the connection object will be passed as the first argument.
- ARRAYREF
-
If the value passed is an array reference, the first element in the array must be a code reference. When the callback is called the code reference will be called with the connection object passed as the first argument and all other values from the array passed after.
- SCALAR
-
All other values passed will be used directly. ie it is the same as passing an code reference that, when called, returns the value.
SEE ALSO
AUTHOR
Graham Barr <gbarr@pobox.com>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap-dev@lists.sourceforge.net>
COPYRIGHT
Copyright (c) 1998-2002 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.