The before_authenticate hook is a method that can be defined in the Application Delegate Class which is called before the authentication step occurs on every request (not just on login). It is meant to be used to perform custom code that may affect the authentication settings.
This hook has been available since Xataface Version 1.2.5.
* Implemented trigger to be called before authentication to set the authentication
* type to basic.
$auth = Dataface_AuthenticationTool::getInstance();
if ( @$_SESSION['-login-type'] == 'basic' ) $auth->setAuthType('basic');
In the above example we used a separate action to store the user's preferred login type in a session variable. This preference is then applied in the before_authenticate method to override the authentication type.
Chain Authentication Support
The most common use of this hook is likely to implement some sort of chain authentication, where authentication methods are attempted until one succeeds.