1 @deftypefn Prototype int (*Gsasl_server_callback_gssapi) (Gsasl_session_ctx * @var{ctx}, char * @var{clientname}, char * @var{authentication_id})
3 @var{ctx}: libgsasl handle.
5 @var{clientname}: input array with GSSAPI client name.
7 @var{authentication_id}: input array with authentication identity.
9 Type of callback function the application implements. It should
10 return GSASL_OK if and only if the GSSAPI user is authorized to log on
11 as the given authentication_id. GSASL_AUTHENTICATION_ERROR is a good
12 failure if authentication failed, but any available return code may be
13 used. This callback is usually implemented in the application as a
14 call to krb5_kuserok(), such as:
18 callback_gssapi (Gsasl_session_ctx *ctx,
20 char *authentication_id)
22 int rc = GSASL_AUTHENTICATION_ERROR;
25 krb5_context kcontext;
27 krb5_init_context (&kcontext);
29 if (krb5_parse_name (kcontext, clientname, &p) != 0)
31 if (krb5_kuserok (kcontext, p, authentication_id))
33 krb5_free_principal (kcontext, p);