gsasl_server_callback_gssapi_set(3)

πŸ“¦ version 1.10.0, in ubuntu jammy

πŸ’– NAME πŸ’–

gsasl_server_callback_gssapi_set β€” bestie, it's an API function πŸŽ€

No cap, that's literally the whole name. It's the little setter that tells your server who's allowed in when GSSAPI is doing its thing. ✨


🌸 SYNOPSIS 🌸

#include <gsasl.h>

void gsasl_server_callback_gssapi_set(Gsasl * ctx,
Gssasl_server_callback_gssapi cb);

okay wait, let me redo that, my brain typed a whole extra letter, embarrassing 😭 the real one is:

#include <gsasl.h>

void gsasl_server_callback_gssapi_set(Gsasl * ctx,
Gsasl_server_callback_gssapi cb);

she returns void, she takes two things, she's lowkey simple and I respect that 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • Gsasl * ctx β€” the libgsasl handle. your main character context object, the whole vibe lives in here πŸ’…
  • Gsasl_server_callback_gssapi cb β€” the callback function itself. yes, you're passing a function to a function. very meta of you. iconic ✨

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea πŸ“

You're running a server. Someone rolls up with GSSAPI credentials and a username, and now you gotta answer the big question: is this user actually authorized for that username? Not just "did they authenticate", bestie β€” authorized. Different thing. πŸ‘‘

So you call gsasl_server_callback_gssapi_set and you hand it a callback function. That function is your bouncer. It gets to decide. And apparently a very normal thing to do inside it is call krb5_kuserok β€” that's the vibe the docs are pointing at. 🧚

Now the contract, and this part matters, don't skip it πŸ™ˆ:

  • Your callback should return GSASL_OK if the user should be permitted access βœ…
  • Otherwise return an error code, like GSASL_AUTHENTICATION_ERROR, when it fails ❌

And if you ever lose track of which callback you set? You can pull it back out later with gsasl_server_callback_gssapi_get(). The getter exists. Balance. 🌈


πŸ’€ DEPRECATED πŸ’€

ma'am. MA'AM. this is the old callback interface. 🚨

Like, it still works, nobody's coming for you, but it's giving legacy. The new interface does it like this:

  • use gsasl_callback_set() to set the application callback
  • then use gsasl_callback() or gsasl_property_get() to invoke that callback for certain properties

That's the glow-up. Same energy, new outfit. If you're writing fresh code, go be a new-interface girlie. πŸŽ€


πŸ› REPORTING BUGS πŸ›

Found a bug? Not you being the bug detective πŸ” β€” report it to <bug-gsasl@gnu.org>.

General guidelines for reporting bugs live here: http://www.gnu.org/gethelp/

And the GNU SASL home page is over at: http://www.gnu.org/software/gsasl/


Copyright Β© 2002-2021 Simon Josefsson.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

(that's the license, and it's very generous of them, we love that for us 🫢)


⭐ SEE ALSO ⭐

The full documentation for gsasl is maintained as a Texinfo manual. If the info and gsasl programs are properly installed at your site, the command

info gsasl

should give you access to the complete manual. As an alternative you may obtain the manual from:

http://www.gnu.org/software/gsasl/manual/

that's it bestie, that's the page πŸ’… go set your callback, return GSASL_OK when they're allowed, and remember the old interface is deprecated so don't @ me when the new one is right there ✨

gsasl 1.10.0 β€” gsasl_server_callback_gssapi_set(3), mwah, sending you the biggest hug from the manpage section of the group chat πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from