1 \input texinfo @c -*-texinfo-*-
9 * SASL: (sasl). The Emacs SASL library.
12 @settitle Emacs SASL Library @value{VERSION}
15 This file describes the Emacs SASL library.
17 Copyright (C) 2000 Daiki Ueno.
19 Permission is granted to copy, distribute and/or modify this document
20 under the terms of the GNU Free Documentation License, Version 1.1 or
21 any later version published by the Free Software Foundation; with no
22 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
23 Texts. A copy of the license is included in the section entitled "GNU
24 Free Documentation License".
30 @title Emacs SASL Library
35 @vskip 0pt plus 1filll
36 Copyright @copyright{} 2000 Daiki Ueno.
38 Permission is granted to copy, distribute and/or modify this document
39 under the terms of the GNU Free Documentation License, Version 1.1 or
40 any later version published by the Free Software Foundation; with no
41 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
42 Texts. A copy of the license is included in the section entitled "GNU
43 Free Documentation License".
51 This manual describes the Emacs SASL library.
53 A common interface to share several authentication mechanisms between
54 applications using different protocols.
57 * Overview:: What Emacs SASL library is.
58 * How to use:: Adding authentication support to your applications.
60 * Backend drivers:: Writing your own drivers.
69 @sc{sasl} is short for @dfn{Simple Authentication and Security Layer}.
70 This standard is documented in RFC2222. It provides a simple method for
71 adding authentication support to various application protocols.
73 The toplevel interface of this library is inspired by Java @sc{sasl}
74 Application Program Interface. It defines an abstraction over a series
75 of authentication mechanism drivers (@ref{Backend drivers}).
77 Backend drivers are designed to be close as possible to the
78 authentication mechanism. You can access the additional configuration
79 information anywhere from the implementation.
86 To use Emacs SASL library, please evaluate following expression at the
87 beginning of your application program.
93 If you want to check existence of sasl.el at runtime, instead you
94 can list autoload settings for functions you want.
99 There are three data types to be used for carrying a negotiated
100 security layer---a mechanism, a client parameter and an authentication
112 A mechanism (@code{sasl-mechanism} object) is a schema of the @sc{sasl}
113 authentication mechanism driver.
115 @defvar sasl-mechanisms
116 A list of mechanism names.
119 @defun sasl-find-mechanism mechanisms
121 Retrieve an apropriate mechanism.
122 This function compares @var{mechanisms} and @code{sasl-mechanisms} then
123 returns apropriate @code{sasl-mechanism} object.
126 (let ((sasl-mechanisms '("CRAM-MD5" "DIGEST-MD5")))
127 (setq mechanism (sasl-find-mechanism server-supported-mechanisms)))
132 @defun sasl-mechanism-name mechanism
133 Return name of mechanism, a string.
136 If you want to write an authentication mechanism driver (@ref{Backend
137 drivers}), use @code{sasl-make-mechanism} and modify
138 @code{sasl-mechanisms} and @code{sasl-mechanism-alist} correctly.
140 @defun sasl-make-mechanism name steps
141 Allocate a @code{sasl-mechanism} object.
142 This function takes two parameters---name of the mechanism, and a list
143 of authentication functions.
146 (defconst sasl-anonymous-steps
147 '(identity ;no initial response
148 sasl-anonymous-response))
150 (put 'sasl-anonymous 'sasl-mechanism
151 (sasl-make-mechanism "ANONYMOUS" sasl-anonymous-steps))
159 A client (@code{sasl-client} object) initialized with four
160 parameters---a mechanism, a user name, name of the service and name of
163 @defun sasl-make-client mechanism name service server
164 Prepare a @code{sasl-client} object.
167 @defun sasl-client-mechanism client
168 Return the mechanism (@code{sasl-mechanism} object) of client.
171 @defun sasl-client-name client
172 Return the authorization name of client, a string.
175 @defun sasl-client-service client
176 Return the service name of client, a string.
179 @defun sasl-client-server client
180 Return the server name of client, a string.
183 If you want to specify additional configuration properties, please use
184 @code{sasl-client-set-property}.
186 @defun sasl-client-set-property client property value
187 Add the given property/value to client.
190 @defun sasl-client-property client property
191 Return the value of the property of client.
194 @defun sasl-client-set-properties client plist
195 Destructively set the properties of client.
196 The second argument is the new property list.
199 @defun sasl-client-properties client
200 Return the whole property list of client configuration.
206 A step (@code{sasl-step} object) is an abstraction of authentication
207 ``step'' which holds the response value and the next entry point for the
208 authentication process (the latter is not accessible).
210 @defun sasl-step-data step
211 Return the data which @var{step} holds, a string.
214 @defun sasl-step-set-data step data
215 Store @var{data} string to @var{step}.
218 To get the initial response, you should call the function
219 @code{sasl-next-step} with the second argument @code{nil}.
222 (setq name (sasl-mechanism-name mechanism))
225 At this point we could send the command which starts a SASL
226 authentication protocol exchange. For example,
231 (if (sasl-step-data step) ;initial response
232 (format "AUTH %s %s\r\n" name (base64-encode-string (sasl-step-data step) t))
233 (format "AUTH %s\r\n" name)))
236 To go on with the authentication process, all you have to do is call
237 @code{sasl-next-step} consecutively.
239 @defun sasl-next-step client step
240 Perform the authentication step.
241 At the first time @var{step} should be set to @code{nil}.
244 @node Backend drivers
245 @chapter Backend drivers
254 @chapter Function Index
258 @chapter Variable Index