1.. saslman:: sasl_callbacks(3) 2 3.. _sasl-reference-manpages-library-sasl_callbacks: 4 5==================================================== 6**sasl_callbacks** - How to work with SASL callbacks 7==================================================== 8 9Synopsis 10======== 11 12.. code-block:: C 13 14 #include <sasl/sasl.h> 15 16Description 17=========== 18 19**sasl_callbacks** are used when the application needs some 20information from the application. Common reasons are getting 21for getting usernames and passwords. A client MUST 22specify what callbacks they support in the 23:saslman:`sasl_client_init(3)`/:saslman:`sasl_server_init(3)` 24or :saslman:`sasl_client_new(3)`/:saslman:`sasl_server_new(3)` 25calls. If an authentication mechanism needs a callback 26that the application does not state it supports it cannot 27be used. 28 29If a callback has an id parameter that should be checked 30to make sure you are giving the appropriate value. 31 32If an application is using the client side of the library 33functions to handle the callbacks are not necessary. 34Instead the application may deal with callbacks via 35SASL_INTERACT's. See :saslman:`sasl_client_start(3)`/:saslman:`sasl_client_step(3)` for more 36information. 37 38Common Callbacks 39---------------- 40 41sasl_getopt_t 42 Get an option value 43 44sasl_log_t 45 Log message handler 46 47sasl_getpath_t 48 Get path to search for plugins (e.g. SASL mechanisms) 49 50sasl_verifyfile_t 51 Verify files for use by SASL 52 53:saslman:`sasl_canon_user_t(3)` 54 Username canonicalization function 55 56Client-only Callbacks 57--------------------- 58 59sasl_getsimple_t 60 Get user/language list 61 62sasl_getsecret_t 63 Get authentication secret 64 65:saslman:`sasl_chalprompt_t(3)` 66 Display challenge and prompt for response 67 68sasl_getrealm_t 69 Get the realm for authentication 70 71Server-only Callbacks 72--------------------- 73 74:saslman:`sasl_authorize_t(3)` 75 Authorize policy callback 76 77sasl_server_userdb_checkpass_t 78 verify plaintext password 79 80sasl_server_userdb_setpass_t 81 set plaintext password 82 83sasl_getconfpath_t 84 Get path to search for SASL configuration file 85 (server side only). New in SASL 2.1.22. 86 87Return value 88============ 89 90SASL callback functions should return SASL return codes. 91See :saslman:`sasl_errors(3)` for a complete list. :c:macro:`SASL_OK` typically indicates success. 92 93Conforming to 94============= 95 96:rfc:`4422` 97 98See Also 99======== 100 101:saslman:`sasl(3)`, :saslman:`sasl_errors(3)`, :saslman:`sasl_authorize_t(3)`, 102:saslman:`sasl_log_t(3)`, :saslman:`sasl_getpath_t(3)`, 103:saslman:`sasl_getconfpath_t(3)`, :saslman:`sasl_verifyfile_t(3)`, 104:saslman:`sasl_canon_user_t(3)`, :saslman:`sasl_getsimple_t(3)`, 105:saslman:`sasl_getsecret_t(3)`, :saslman:`sasl_chalprompt_t(3)`, 106:saslman:`sasl_getrealm_t(3)`, :saslman:`sasl_server_userdb_checkpass_t(3)`, 107:saslman:`sasl_server_userdb_setpass_t(3)` 108