Authen::SASL::Cyrus - XS SASL Authentication
use Authen::SASL; $sasl = Authen::SASL->new( mechanism => 'NAME', callback => { NAME => VALUE, NAME => VALUE, ... }, ); $conn = $sasl->client_new(<service>, <server>);
SASL is a generic mechanism for authentication used by several network protocols. Authen::SASL::Cyrus provides an implementation framework that all protocols should be able to share.
The XS framework makes calls into the existing libsasl2.so shared library to perform SASL client connection functionality, including loading existing shared library mechanisms.
The contructor may be called with or without arguments. Passing arguments is just a short cut to calling the mechanism and callback methods.
mechanism
callback
Creates and returns a new connection object blessed into Authen::SASL::Cyrus. It is on that returned reference that the following methods are available. The SERVICE is the name of the service being implemented, which may be used by the underlying mechanism. An example service is "ldap". The HOST is the name of the server being contacted, which may also be used by the underlying mechanism.
Tells if the named callback has a handler installed. The list of implemented callbacks is "user", "auth", and "language". Others may be implemented in future releases.
Sets the given callback(s) to the given value(s). See the Callbacks section for a description of callback VALUEs. See above for a list of implemented callback NAMEs.
Callbacks
The initial step to be performed. Returns the initial value to pass to the server.
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.
Returns a 1 if an error has occurred in any step along the way. See the error method to get a better explanation of what error occurred. Returns a 0 if no errors have occurred.
error
Returns a string with a brief description of what caused the last error, AND clears the error message so that subsequent calls will return an empty string until another error occurs.
Returns the host argument that was passed to client_new =item mechanism
client_new
Returns the SASL mechanism currently in use. It should match one of the installed SASL shared library mechanisms (see your SASL distribution for a list of available mechanisms).
Gets the SASL value for the named property. Currently implemented property names are: "user", "ssf", "maxout", "realm", "optctx", "iplocal" | "sockname", "ipremote" | "peername".
Sets the named property(ies) to the given value(s). Currently implemented property names are given above.
Returns the service argument that was passed to client_new
There are three different ways in which a callback may be passed
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.
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 the second value from the array passed after. The code reference should return a scalar value which is the answer to the callback, e.g. a "user" callback should return a single string which is the username of the client.
All other values passed will be returned directly to the SASL library as the answer to the callback.
Authen::SASL
Mark Adamson <mark@nb.net>
Please report any bugs, or post any suggestions, to the author.
Copyright (c) 2005 Carnegie Mellon University. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
To install Authen::SASL::Cyrus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Authen::SASL::Cyrus
CPAN shell
perl -MCPAN -e shell install Authen::SASL::Cyrus
For more information on module installation, please visit the detailed CPAN module installation guide.