SASL_AUTHORIZE_T(3)

πŸ’– sasl_authorize_t(3) β€” Cyrus SASL, bestie edition πŸ’–

okay so real talk, this one lives in the Cyrus SASL manual, section 3, and it's literally the bouncer-at-the-club of the SASL world. let's get into it 🫢


✨ NAME ✨

sasl_authorize_t β€” Cyrus SASL documentation πŸ“–


🌸 SYNOPSIS 🌸

#include <sasl/sasl.h>

int sasl_authorize_t(void *context,
                    const char *requested_user, unsigned alen,
                    const char *auth_identity, unsigned alen,
                    const char *def_realm, unsigned urlen,
                    struct propctx *propctx)

like yes, alen shows up twice, that's just how it is, we don't question the ancestors πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so sasl_authorize_t is the callback that answers the question: is this allowed?? specifically, it checks whether the authorized user auth_identity is actually permitted to act as the user requested_user. it's giving "who do you think you are" but make it polite ✨

the classic example, and it's a good one: the user root might wanna authenticate with his own credentials but then act as the user mmercer β€” and when that happens, it's with all of mmercer's rights, not root's. big difference, no cap. πŸ‘‘

⚠️ a server application should be very careful here, and should probably err on the side of caution when deciding which users are allowed to proxy as which other users. this is not the place to be chill and generous. this is the place to be a little paranoid, bestie. πŸ™ˆ

πŸ’œ RETURN VALUE πŸ’œ

SASL callback functions should return SASL return codes β€” peek at sasl.h for the full list, it's all in there. and SASL_OK means success. that's the one you want. πŸŽ€


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

The Cyrus Team β€” icons only, we stan πŸ’…


1993-2016, The Cyrus Team


and that's the whole page, you ate it, you understood it, go forth and authorize responsibly 🧚✨

this little deep-dive comes from Cyrus SASL 2.1.28, dated February 18, 2022 β€” mwah, sending you the manual page equivalent of a forehead kiss πŸ’–πŸŒΈπŸ«Ά