AuthHandler


Description:


public delegate bool AuthHandler (AuthContext context, string username)

Functions implementing this callback shall return true when the credentials provided by the authentication request grant access to the resource described by context.

The username is null when no creditials were passed, and anonymous access is tried.

See also set_auth_flags. When EPC_AUTH_DEFAULT is used, you should call check_password to verify that the password passed in the request matches the known password for that user. In this case there is no way to retrieve the password from the AuthContext because the network protocol transfers just a hash code, not the actual password.

However, when EPC_AUTH_PASSWORD_TEXT_NEEDED is used, you should call get_password and then do your own authentication check. For instance, you might need to delegate the authentication to some other code or server, such as a database server.

Parameters:

context

the AuthContext

username

the username provided for authentication, or null

user_data

user data set when the signal handler was installed

Returns:

true when access is granted, and false otherwise.


Namespace: Epc
Package: libepc-1.0