My requirement is to do an additional custom validation once the users core joomla credentials are validated. If my custom validation fails then I should not allow the user to login.
I see there are only 2 plugin methods I can make use of it.
onUserLogin
This method will be called only after a successful login which is fine. If I return false it still allows the user to login to the website. I tried JFactory::getApplication()->logout();
but it still allows the user to login.
onUserAuthenticate
If I go via this route then I have to implement the whole authentication functionality on my own. (something like copy the core joomla authentication plugin and add my own code)
Is there a simplest way? I.e, once the core joomla authentication is complete I have to do an additional validation and if fails do not allow the member to login...