Yes, you can use different drivers at once. Just create another instance instead of standard singleton:
// default Auth
$config = Kohana::$config->load('auth');
$auth = new Auth($config);
$user = $auth->get_user();
// special Auth for administration
$config2 = Kohana::$config->load('admin_auth');
$auth2 = new Auth($config2);
$admin = $auth2->get_user();
Restrictions:
- You must use differ configs (
driver
andsession_key
values must differ). Note that some settings are defined in classes and cant be changed by config (for example, "remember" cookie namedauthautologin
). - You cant share default ORM models (
Model_User
,Model_Token
,Model_Role
), because their names are hardcoded. But ORM driver & File driver can be used.