Diffusion C API 6.13.0
Loading...
Searching...
No Matches
Authentication Control

Functions

void diffusion_set_authentication_handler (SESSION_T *session, const DIFFUSION_AUTHENTICATION_HANDLER_PARAMS_T params)
 Register an authentication handler for client authentication events.
bool diffusion_revoke_authentication (SESSION_T *session, const DIFFUSION_REVOKE_AUTHENTICATION_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Revokes a session's authentication.

Detailed Description

Allows a client session to authenticate the credentials of other sessions, and optionally revoke such authentications.

Sessions are authenticated by a chain of authenticators. A client session can participate in the authentication process by creating an authenticator and registering it with the server.

Each authenticator is registered under a particular authenticator name. For registration to succeed, the server's security configuration must include a matching control-authentication-handler entry for the name, otherwise registration will fail and the authenticator will be closed immediately.

Each client session can register a single authenticator for a given authenticator name.

For each authentication event, the server will use its configuration to determine the authenticator priority order. The server may call authenticators in serial or parallel. The server may stop the authentication process as soon as it has an allow or deny response from an authenticator and all higher priority authenticators have abstained.

For a configured control authenticator, the server will select a single authenticator from those registered for the authenticator name. If no authenticators are currently registered, the server will consult the next configured authenticator in priority order.

Access control

In order to register an authenticator a session needs both REGISTER_HANDLER REGISTER_HANDLER and AUTHENTICATE permissions.

In order to revoke a session's authentication a session needs both MODIFY_SESSION and AUTHENTICATE permissions.

Function Documentation

◆ diffusion_revoke_authentication()

bool diffusion_revoke_authentication ( SESSION_T * session,
const DIFFUSION_REVOKE_AUTHENTICATION_PARAMS_T params,
DIFFUSION_API_ERROR * api_error )

Revokes a session's authentication.

This will immediately close the specified client session.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing the diffusion_revoke_authentication request and callback handlers which may be invoked in response.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful. False, otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
Since
6.12

◆ diffusion_set_authentication_handler()

void diffusion_set_authentication_handler ( SESSION_T * session,
const DIFFUSION_AUTHENTICATION_HANDLER_PARAMS_T params )

Register an authentication handler for client authentication events.

Parameters
sessionThe session handle. If NULL, this function returns immediately with the value NULL.
paramsParameters defining the request to register an authentication handler.