How can I make Rules react to `User has logged in` when user logs in through CAS? I want to execute some php code when users log in, so I'm experimenting with the Rules module. I have it configured to fire a function of mine when a user logs in and it works fine, but it only works if the user logs in through Drupal. I am using CAS to authenticate users (thanks to the CAS module) and if a user logs in with CAS, the function never gets called. Is there any way to solve this?

Here is the function which is successfully called when a user logs in through Drupal:

myModuleName.rules.inc

function myModuleName_rules_action_info () {
    return array(
        'hello_rules_world' =&gt; array(
            'label' =&gt; "Print Hello World to error.log"
        )
    );
}

function hello_rules_world () {
    error_log("Hello Rules World!");
}


And here is a screenshot of the configuration:



UPDATE: I ended up using hook_user_login, which detects all logins without problem:

myModuleName.module

function myModuleName_user_login (&amp;$edit, $account) {
    my_user_login_function($account);
}
I ended up using hook_user_login, which detects all logins without problem:

myModuleName.module

function myModuleName_user_login (&amp;$edit, $account) {
    my_user_login_function($account);
}