Plugin hooks

wp_cassify_after_cas_authentication

This hook is used to perform action just after CAS authentication but before WordPress Authentication. You can use like below. Put this code in your functions.php file or in another plugin file (loaded after WP Cassify plugin).

add_action( 'wp_cassify_after_cas_authentication', 'custom_action_after_cas_authenfication', 1, 1 ); 

function custom_action_after_cas_authenfication( $cas_user_datas ) {
		
	if ( $cas_user_datas[ 'cas_user_id' ] == 'tferguson4' ) {
		die ( 'tferguson is not allowed !' );
	}
}

wp_cassify_before_auth_user_wordpress

This hook is used to perform action just before wordpress authentication but after CAS authentication. Put this code in your functions.php file or in another plugin file (loaded after WP Cassify plugin).

add_action( 'wp_cassify_before_auth_user_wordpress', 'custom_action_before_auth_user_wordpress', 1, 1 ); 

function custom_action_before_auth_user_wordpress( $cas_user_datas ) {

     // Force CAS logout if user account does not already exist in WordPress database.	
     if (! username_exists( $cas_user_datas[ 'cas_user_id' ] ) ) {
            $GLOBALS['wp-cassify']->wp_cassify_logout();
     }
}

wp_cassify_before_redirect

This hook is used to perform action just before WP Cassify make a redirection to CAS Server if user is not yet authenticated. Put this code in your functions.php file or in another plugin file (loaded after WP Cassify plugin).

add_action( 'wp_cassify_before_redirect', 'custom_action_before_redirect', 1 ); 

function custom_action_before_redirect() {
       // Put your code here.
}

wp_cassify_after_redirect

This hook is used to perform action just at the end of wp_cassify_before_redirect function. It’s very useful when you’re already authenticated to CAS and if you want to perform action when you access to another blog authenticated by WP Cassify. Put this code in your functions.php file or in another plugin file (loaded after WP Cassify plugin).

add_action( 'wp_cassify_after_redirect', 'custom_action_after_redirect', 1, 1 ); 

function custom_action_after_redirect( $user_id ) {
       // Put your code here.
}