Hi,
In new version 1.6.6, i’ve created a new custom hook. You can use like this in your functions.php (located inside your theme) 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 ) {
if (! username_exists( $cas_user_datas[ ‘cas_user_id’ ] ) ) {
$GLOBALS[‘wp-cassify’]->wp_cassify_logout();
}
}
Keep me informed if it solved your problem.
Best regards.
Hi,
The action is works, but it will redirect to CAS logout page immediately, the message “User account does not exists in WordPress database !” will be skipped.
Then, the user will not know the reason why auto logout immediately.
Sorry for one more question, i have installed another plugin called “WPS Hide Login” and update cms login url to xxx.com/login, then after CAS login, it redirect to xxx.com instead of xxx.com/login
How to handle it?
Hi,
First of all, please re-post the seconde question in new thread, it would be clearly for another users.
Okay, it’s normal that you’re redirected directly to standard CAS logout page. Probably, you’ve not configured your CAS server with “followServiceRedirects” option.
https://jasig.github.io/cas/4.2.x/installation/Logout-Single-Signout.html
- Deactivate WPS Hide Login plugin
- Configure followServiceRedirects option in your CAS Server. Edit cas.properties file and then put this option to “true” like below.
- Create a public page in your blog where your explain the reason of user logout : You’ve been disconnected because you’ve not local WordPress Account ! Please contact [email protected]
- In WP Cassify admin page, in Authorization rules settings panel, put url of public logout page previously created in User not allowed redirect url field
- Update changes
In your cas.properties (On your CAS Server) :
cas.logout.followServiceRedirects=true
NB : If you leave empty User not allowed redirect url option, home_url() is used instead.
Keep me informed if it solved your problem.
Best regards.
No reply 4 days ago. So, i close ticket.