Update documentation.
[m6w6/libmemcached] / docs / memcached_sasl.rst
1 ============
2 SASL support
3 ============
4
5 .. index:: object: memcached_st
6
7
8 --------
9 SYNOPSIS
10 --------
11
12 #include <libmemcached/memcached_pool.h>
13
14 .. c:function:: void memcached_set_sasl_callbacks(memcached_st *ptr, const sasl_callback_t *callbacks)
15
16 .. c:function:: const sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr)
17
18 .. c:function:: memcached_return memcached_set_sasl_auth_data(memcached_st *ptr, const char *username, const char *password)
19
20 .. c:function:: memcached_return memcached_destroy_sasl_auth_data(memcached_st *ptr)
21
22 Compile and link with -lmemcached
23
24
25
26 -----------
27 DESCRIPTION
28 -----------
29
30
31 libmemcached(3) allows you to plug in your own callbacks function used by
32 libsasl to perform SASL authentication.
33
34 Please note that SASL requires the memcached binary protocol, and you have
35 to specify the callbacks before you connect to the server.
36
37 memcached_set_sasl_auth_data() is a helper function defining
38 the basic functionality for you, but it will store the username and password
39 in memory. If you choose to use this method you have to call
40 memcached_destroy_sasl_auth_data before calling memcached_free to avoid
41 a memory leak. You should NOT call memcached_destroy_sasl_auth_data if you
42 specify your own callback function with memcached_set_sasl_callbacks().
43
44 You as a client user have to initialize libsasl by using sasl_client_init
45 before enabling it in libmemcached, and you have to shut down libsasl by
46 calling sasl_done() when you are done using SASL from libmemcached.
47
48
49 ------
50 RETURN
51 ------
52
53
54 memcached_get_sasl_callbacks() returns the callbacks currently used
55 by this memcached handle.
56 memcached_get_sasl_set_auth_data() returns MEMCACHED_SUCCESS upon success.
57
58
59 ----
60 HOME
61 ----
62
63
64 To find out more information please check:
65 `http://libmemcached.org/ <http://libmemcached.org/>`_
66
67
68 ------
69 AUTHOR
70 ------
71
72
73 Brian Aker, <brian@tangent.org>
74
75 Trond Norbye, <trond.norbye@gmail.com>
76
77
78 --------
79 SEE ALSO
80 --------
81
82
83 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`