Foros de discusión

Display number of failed login attempt on jsp

Prateeksha Mandloi, modificado hace 8 años.

Display number of failed login attempt on jsp

Regular Member Mensajes: 112 Fecha de incorporación: 5/02/14 Mensajes recientes
Hi,

My requirement is to display number of attempts made by user while logging-in; whenever he enters wrong credentials. It should display "Authentication falied, 2 more attempts remaining ". Can anyone help.

Thanks in advance.
thumbnail
David H Nebinger, modificado hace 8 años.

RE: Display number of failed login attempt on jsp

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Liferay counts failed counts in the user record. Number of allowed failures comes from the password policy, so it is somewhat dynamic.
Prateeksha Mandloi, modificado hace 8 años.

RE: Display number of failed login attempt on jsp

Regular Member Mensajes: 112 Fecha de incorporación: 5/02/14 Mensajes recientes
Hi David,

Thanks for such prompt reply.

And yes, I want to display the dynamic value on jsp, as user tries logging-in, any help on how to achieve this ??
thumbnail
David H Nebinger, modificado hace 8 años.

RE: Display number of failed login attempt on jsp

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
If I had to do this, I would hook the login.jsp. In the checks for errors, I would include the code to pull the User object to check the fail count. I'd also access the current password policy to get the count. You'd have all you need to output the message.
Tzé ying Yan, modificado hace 6 años.

RE: Display number of failed login attempt on jsp

New Member Mensajes: 2 Fecha de incorporación: 6/03/17 Mensajes recientes
Hi,

I have the same problem, I need to show the number of attempts left.
I created a Hook with login.jsp and a class that implements AuthFailure, so I might log the number of attempts.

But in my class, I couldn't access to Request Object to put the number of attempts as parameter for my JSP. And the parameter "login" in login.jsp is null, I suppose it's because the logging it's failed.

So, can you show me how do you do to pull the User? Maybe override the class LoginAction?

Thanks