authuserdb: Try using a separate get-token script.
[hcoop/debian/courier-authlib.git] / auth_sasl.3
CommitLineData
d9898ee8 1.\" <!-- $Id: auth_sasl.sgml,v 1.3 2007/04/01 00:21:34 mrsam Exp $ -->
2.\" <!-- Copyright 2004 Double Precision, Inc. See COPYING for -->
3.\" <!-- distribution information. -->
4.\" Title: auth_sasl
5.\" Author:
6.\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
7.\" Date: 04/06/2007
8.\" Manual: Double Precision, Inc.
9.\" Source: Double Precision, Inc.
10.\"
11.TH "AUTH_SASL" "3" "04/06/2007" "Double Precision, Inc." "Double Precision, Inc."
12.\" disable hyphenation
13.nh
14.\" disable justification (adjust text to left margin only)
15.ad l
16.SH "NAME"
17auth_sasl \- SASL implementation
18.SH "SYNOPSIS"
19.sp
20.RS 4
21.nf
22#include <courierauthsasl.h>
23.fi
24.RE
25.HP 17
26.BI "int rc=auth_sasl(const\ char\ *" "method" ", const\ char\ *" "initialresponse" ", char\ *(*" "conversation_func" ")(const\ char\ *,\ void\ *), void\ *" "callback_arg" ", char\ **" "authtype_ret" ", char\ **" "authdata_ret" ");"
27.SH "DESCRIPTION"
28.PP
29
30\fBauth_sasl\fR
31is a generic
32SASL
33server implementation.
34\fImethod\fR
35is the requested
36SASL
37method. At this time
38\fBauth_sasl\fR
39knows how to handle the following SASL methods:
40.RS 4
41\h'-04'\(bu\h'+03'LOGIN
42.RE
43.RS 4
44\h'-04'\(bu\h'+03'PLAIN
45.RE
46.RS 4
47\h'-04'\(bu\h'+03'CRAM\-MD5
48.RE
49.RS 4
50\h'-04'\(bu\h'+03'CRAM\-SHA1
51.RE
52.PP
53
54\fIinitialresponse\fR
55is a base64\-encoded initial response provided in the client's
56SASL
57request.
58\fIinitialresponse\fR
59must be
60NULL
61if an initial response was not included in the client's
62SASL
63request.
64.PP
65
66\fIconversation_func\fR
67is the application\-implemented
68SASL
69conversation callback function.
70\fIconversation_func\fR
71receives a base64\-encoded
72SASL
73prompt, and the
74\fIcallback_arg\fR
75argument to
76\fBauth_sasl\fR.
77\fIconversation_func\fR
78must return a buffer containing the base64\-encoded reply from the client.
79\fBauth_sasl\fR
80will
81\fBfree\fR(3)
82this buffer when it's done.
83\fIconversation_func\fR
84should return
85NULL
86to abort the
87SASL
88conversation.
89.SH "RETURNS"
90.PP
91If the
92SASL
93conversation succesfully completes,
94\fBauth_sasl\fR
95initializes
96\fI*authtype_ret\fR
97and
98\fI*authdata_ret\fR. They will be set to a
99\fBmalloc\fR(3)\-ed buffers that can be directly passed as arguments to
100\fI\fBauth_generic\fR(3)\fR\&[1]. It is the application's responsibility to
101\fBfree\fR(3)
102these buffers when it's done with them.
103.PP
104
105\fBauth_sasl\fR
106returns
107AUTHSASL_OK
108when the
109SASL
110conversation succesfully completes, and
111\fI*authtype_ret\fR
112and
113\fI*authdata_ret\fR
114are succesfully assembled. Any other return indicates an error condition. Right now two error conditions are defined:
115.PP
116AUTHSASL_ABORTED
117.RS 4
118The
119SASL
120conversation was aborted by the client.
121.RE
122.PP
123AUTHSASL_ERROR
124.RS 4
125General error (insufficient memory, or some other reason). Check
126\fIerrno\fR
127for any clues.
128.RE
129.SH "SEE ALSO"
130.PP
131
132\fI\fBauthlib\fR(3)\fR\&[2],
133\fI\fBauth_generic\fR(3)\fR\&[1].
134.SH "REFERENCES"
135.IP " 1." 4
136\fBauth_generic\fR(3)
137.RS 4
138\%auth_generic.html
139.RE
140.IP " 2." 4
141\fBauthlib\fR(3)
142.RS 4
143\%authlib.html
144.RE