1Authen::SASL(3) User Contributed Perl Documentation Authen::SASL(3)
2
3
4
6 Authen::SASL - SASL Authentication framework
7
9 use Authen::SASL;
10
11 $sasl = Authen::SASL->new(
12 mechanism => 'CRAM-MD5 PLAIN ANONYMOUS',
13 callback => {
14 pass => \&fetch_password,
15 user => $user,
16 }
17 );
18
20 SASL is a generic mechanism for authentication used by several network
21 protocols. Authen::SASL provides an implementation framework that all
22 protocols should be able to share.
23
24 The framework allows different implementations of the connection class
25 to be plugged in. At the time of writing there were two such plugins.
26
27 Authen::SASL::Perl
28 This module implements several mechanisms and is implemented
29 entirely in Perl.
30
31 Authen::SASL::Cyrus
32 This module uses the Cyrus SASL C-library (both version 1 and 2 are
33 supported).
34
35 By default the order in which these plugins are selected is
36 Authen::SASL::Cyrus first and then Authen::SASL::Perl.
37
38 If you want to change it or want to specifically use one implementation
39 only simply do
40
41 use Authen::SASL qw(Perl);
42
43 or if you have another plugin module that supports the Authen::SASL API
44
45 use Authen::SASL qw(My::SASL::Plugin);
46
47 CONTRUCTOR
48
49 The contructor may be called with or without arguments. Passing argu‐
50 ments is just a short cut to calling the "mechanism" and "callback"
51 methods.
52
53 METHODS
54
55 mechanism
56 Returns the current list of mechanisms
57
58 mechanism NAMES
59 Set the list of mechanisms to choose from. NAMES should be a space
60 separated string of the names.
61
62 callback NAME
63 Returns the current callback associated with NAME
64
65 callback NAME => VALUE, NAME => VALUE, ...
66 Sets the given callbacks to the given values
67
68 client_new SERVICE, HOST, SECURITY
69 Creates and returns a new connection object for a client-side con‐
70 nection.
71
72 server_new SERVICE, HOST
73 Creates and returns a new connection object for a server-side con‐
74 nection. Currently only supported by Authen::SASL::Cyrus.
75
76 error
77 Returns any error from the last connection
78
80 server_start ( CHALLENGE )
81 server_start begins the authentication using the chosen mechanism.
82 If the mechanism is not supported by the installed SASL it fails.
83 Because for some mechanisms the client has to start the negotia‐
84 tion, you can give the client challenge as a parameter.
85
86 server_step ( CHALLENGE )
87 server_step performs the next step in the negotiation process. The
88 first parameter you give is the clients challenge/response.
89
90 client_start
91 The initial step to be performed. Returns the initial value to pass
92 to the server or an empty list on error.
93
94 client_step CHALLENGE
95 This method is called when a response from the server requires it.
96 CHALLENGE is the value from the server. Returns the next value to
97 pass to the server or an empty list on error.
98
99 answer NAME
100 The method will return the value returned from the last call to the
101 callback NAME
102
103 property NAME
104 property NAME => VALUE, NAME => VALUE
105 service
106 Returns the service argument that was passed to *_new-methods.
107
108 host
109 Returns the host argument that was passed to *_new-methods.
110
111 mechanism
112 Returns the name of the chosen mechanism.
113
114 Callbacks
115
116 There are three different ways in which a callback may be passed
117
118 CODEREF
119 If the value passed is a code reference then, when needed, it will
120 be called and the connection object will be passed as the first
121 argument. In addition some callbacks may be passed additional argu‐
122 ments.
123
124 ARRAYREF
125 If the value passed is an array reference, the first element in the
126 array must be a code reference. When the callback is called the
127 code reference will be called with the connection object passed as
128 the first argument and all other values from the array passed
129 after.
130
131 SCALAR
132 All other values passed will be used directly. ie it is the same as
133 passing an code reference that, when called, returns the value.
134
136 Authen::SASL::Perl, Authen::SASL::Cyrus (for more methods that cur‐
137 rently only support by Authen::SASL::Cyrus)
138
140 Graham Barr <gbarr@pobox.com>
141
142 Please report any bugs, or post any suggestions, to the perl-ldap mail‐
143 ing list <perl-ldap@perl.org>
144
146 Copyright (c) 1998-2005 Graham Barr. All rights reserved. This program
147 is free software; you can redistribute it and/or modify it under the
148 same terms as Perl itself.
149
150
151
152perl v5.8.8 2006-03-25 Authen::SASL(3)