0
  M   aˆl–ßi~”Jn-j�ràq�©‹Fÿ�þBãŽ¬Ñ(›�él€þäƒmÖ[ãa–Ãa¾”J_)â�rãn\ªbÑ¿â g    a
=head1 NAME

Authen::SASL - SASL Authentication framework

=head1 SYNOPSIS

 use Authen::SASL;

 $sasl = Authen::SASL->new(
   mechanism => 'CRAM-MD5 PLAIN ANONYMOUS',
   callback => {
     pass => \&fetch_password,
     user => $user,
   }
 );

=head1 DESCRIPTION

SASL is a generic mechanism for authentication used by several
network protocols. B<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.

=over 4

=item Authen::SASL::Perl

This module implements several mechanisms and is implemented
entirely in Perl.

=item Authen::SASL::XS

This module uses the Cyrus SASL C-library (both version 1 and 2 
are supported).

=item Authen::SASL::Cyrus

This module is the predecessor to L<Authen::SASL::XS>. It is reccomended
to use L<Authen::SASL::XS>

=back

By default the order in which these plugins are selected is 
Authen::SASL::XS, Authen::SASL::Cyrus and then Authen::SASL::Perl.

If you want to change it or want to specifically use one
implementation only simply do

 use Authen::SASL qw(Perl);

or if you have another plugin module that supports the Authen::SASL API

 use Authen::SASL qw(My::SASL::Plugin);

=head2 CONTRUCTOR

=over 4

=item new ( OPTIONS )

The constructor may be called with or without arguments. Passing arguments is
just a short cut to calling the C<mechanism> and C<callback> methods.

=over 4

=item callback =E<gt> { NAME => VALUE, NAME => VALUE, ... }

Set the callbacks.
See the L<callback|/callback> method for details.

=item mechanism =E<gt> NAMES

=item mech =E<gt> NAMES

Set the list of mechanisms to choose from.
See the L<mechanism|/mechanism> method for details.

=item debug =E<gt> VALUE

Set the debug level bit-value to C<VALUE> 

Debug output will be sent to C<STDERR>. The
bits of this value are:

 1   Show debug messages in the Perl modules for the mechanisms.
     (Currently only used in GSSAPI)
 4   With security layers in place show information on packages read.
 8   With security layers in place show information on packages written.

The default value is 0.

=back

=back

=head2 METHODS

=over 4

=item mechanism ( )

Returns the current list of mechanisms

=item mechanism ( NAMES )

Set the list of mechanisms to choose from. C<NAMES> should be a space separated string
of the names.

=item callback ( NAME )

Returns the current callback associated with C<NAME>.

=item callback ( NAME => VALUE, NAME => VALUE, ... )

Sets the given callbacks to the given values

=item client_new ( SERVICE, HOST, SECURITY )

Creates and returns a new connection object for a client-side connection.

=item server_new ( SERVICE, HOST, OPTIONS )

Creates and returns a new connection object for a server-side connection.

=item error ( )

Returns any error from the last connection

=back

=head1 The Connection Class

=over 4

=item server_start ( CHALLENGE )

server_start begins the authentication using the chosen mechanism.
If the mechanism is not supported by the installed SASL it fails.
Because for some mechanisms the client has to start the negotiation,
you can give the client challenge as a parameter.

=item server_step ( CHALLENGE )

server_step performs the next step in the negotiation process. The
first parameter you give is the clients challenge/response.

=item client_start ( )

The initial step to be performed. Returns the initial value to pass to the server
or an empty list on error.

=item 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.

=item need_step ( )

Returns true if the selected mechanism requires another step before completion
(error or success).

=item answer ( NAME )

The method will return the value returned from the last call to the callback NAME

=item property 