Custom authentication


Custom authentication method allows one to write their own authentication method by extending the Custom_authentication-class found in mydbr/user/custom_authentication.php.


When user enters username and password to login dialog, the values are passed into static function Custom_authentication::authenticate($username, $password). If the user is successfully authenticated with a custom code, the function should return a user record. If authentication is not successful, a null is returned.

The user record is an array with obligatory fields: name, admin and groups. Additionally, the user record can have email and telephone info for the user.

$user['name']: username
$user['admin']: 1=admin, 0=normal user
$user['groups']: array of groupnames user belongs to. Example: array('Sales', 'HR', 'Production'), null if groups are not handled here but inside myDBR
$user['email']: optional user's email
$user['telephone']: optional user's telephone number