Audting the Login Failure in liferay
In Liferay we can audit login failure for the user just by writing the hook. We have property which we need to add in portal.properties file as. auth.failure = com.sample.events.hook.LoginFailureAudit. Then create a class and extend with the AuthFailure public class LoginFailureAudit implements AuthFailure { public void onFailureByEmailAddress(long companyId, String emailAddress, Map<String, String[]> headerMap, Map<String, String[]> parameterMap) throws AuthException { long userId = UserLocalServiceUtil.getUserByScreenName(companyId, emailAddress).getUserId(); User user = UserLocalServiceUtil.getUser(userId); System.out.println("login failure attempts are"+user.getFailedLoginAttempts()); } public void onFailureByScreenName(long companyId, String screenName, Map<String, String[]> headerMap, Map<String, String[]> parameterMap) throws AuthException { long userId = UserLocalServiceUtil.g...