Set the userdb path to be /etc/courier/userdb.
[hcoop/debian/courier-authlib.git] / auth_sasl.html
CommitLineData
d9898ee8 1<?xml version="1.0"?>
2<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>auth_sasl</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"/><link rel="start" href="#auth-sasl" title="auth_sasl"/><link xmlns="" rel="stylesheet" type="text/css" href="manpage.css"/><meta xmlns="" name="MSSmartTagsPreventParsing" content="TRUE"/><link xmlns="" rel="icon" href="icon.gif" type="image/gif"/><!--
3
4Copyright 1998 - 2007 Double Precision, Inc. See COPYING for distribution
5information.
6
7--></head><body><div class="refentry" lang="en" xml:lang="en"><a id="auth-sasl" shape="rect"> </a><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>auth_sasl — <acronym class="acronym">SASL</acronym> implementation</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="literallayout"><p><br clear="none"/>
8#include &lt;courierauthsasl.h&gt;<br clear="none"/>
9</p></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td rowspan="1" colspan="1"><code class="funcdef">int rc=<b class="fsfunc">auth_sasl</b>(</code></td><td rowspan="1" colspan="1">const char * </td><td rowspan="1" colspan="1"><var class="pdparam">method</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">const char * </td><td rowspan="1" colspan="1"><var class="pdparam">initialresponse</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">char *(* </td><td rowspan="1" colspan="1"><var class="pdparam">conversation_func</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">void * </td><td rowspan="1" colspan="1"><var class="pdparam">callback_arg</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">char ** </td><td rowspan="1" colspan="1"><var class="pdparam">authtype_ret</var>, </td></tr><tr><td rowspan="1" colspan="1"> </td><td rowspan="1" colspan="1">char ** </td><td rowspan="1" colspan="1"><var class="pdparam">authdata_ret</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id282347" shape="rect"> </a><h2>DESCRIPTION</h2><p>
10<code class="function">auth_sasl</code>
11is a generic <acronym class="acronym">SASL</acronym> server implementation.
12<em class="parameter"><code>method</code></em> is the requested <acronym class="acronym">SASL</acronym>
13method.
14At this time
15<code class="function">auth_sasl</code>
16knows how to handle the following SASL methods:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">LOGIN</code></p></li><li><p><code class="literal">PLAIN</code></p></li><li><p><code class="literal">CRAM-MD5</code></p></li><li><p><code class="literal">CRAM-SHA1</code></p></li></ul></div><p>
17<em class="parameter"><code>initialresponse</code></em>
18is a base64-encoded initial response provided in the client's
19<acronym class="acronym">SASL</acronym> request.
20<em class="parameter"><code>initialresponse</code></em>
21must be <code class="literal">NULL</code> if an initial response was not included in
22the client's <acronym class="acronym">SASL</acronym> request.</p><p>
23<em class="parameter"><code>conversation_func</code></em>
24is the application-implemented <acronym class="acronym">SASL</acronym>
25conversation callback function.
26<em class="parameter"><code>conversation_func</code></em>
27receives a base64-encoded <acronym class="acronym">SASL</acronym> prompt,
28and the <em class="parameter"><code>callback_arg</code></em>
29argument to <code class="function">auth_sasl</code>.
30<em class="parameter"><code>conversation_func</code></em>
31must return a buffer containing the base64-encoded reply from the client.
32<code class="function">auth_sasl</code>
33will
34<span class="citerefentry"><span class="refentrytitle">free</span>(3)</span>
35this buffer when it's done.
36<em class="parameter"><code>conversation_func</code></em>
37should return <code class="literal">NULL</code>
38to abort the <acronym class="acronym">SASL</acronym> conversation.</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="id282718" shape="rect"> </a><h2>RETURNS</h2><p>
39If the <acronym class="acronym">SASL</acronym> conversation succesfully completes,
40<code class="function">auth_sasl</code>
41initializes <em class="parameter"><code>*authtype_ret</code></em> and
42<em class="parameter"><code>*authdata_ret</code></em>.
43They will be set to a
44<span class="citerefentry"><span class="refentrytitle">malloc</span>(3)</span>-ed
45buffers that can be directly passed as arguments to
46<a href="auth_generic.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">auth_generic</span>(3)</span></a>.
47It is the application's responsibility to
48<span class="citerefentry"><span class="refentrytitle">free</span>(3)</span>
49these buffers when it's done with them.</p><p>
50<code class="function">auth_sasl</code>
51returns
52<code class="literal">AUTHSASL_OK</code> when the
53<acronym class="acronym">SASL</acronym> conversation succesfully completes, and
54<em class="parameter"><code>*authtype_ret</code></em> and
55<em class="parameter"><code>*authdata_ret</code></em> are succesfully assembled.
56Any other return indicates an error condition.
57Right now two error conditions are defined:</p><div class="variablelist"><dl><dt><span class="term"><code class="literal">AUTHSASL_ABORTED</code></span></dt><dd><p>
58The <acronym class="acronym">SASL</acronym> conversation was aborted by the client.</p></dd><dt><span class="term"><code class="literal">AUTHSASL_ERROR</code></span></dt><dd><p>
59General error (insufficient memory, or some other reason).
60Check <code class="varname">errno</code> for any clues.</p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="id282008" shape="rect"> </a><h2>SEE ALSO</h2><p>
61<a href="authlib.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">authlib</span>(3)</span></a>,
62
63<a href="auth_generic.html" target="_top" shape="rect"><span class="citerefentry"><span class="refentrytitle">auth_generic</span>(3)</span></a>.</p></div></div></body></html>