留言板

Display number of failed login attempt on jsp

Prateeksha Mandloi,修改在8 年前。

Display number of failed login attempt on jsp

Regular Member 帖子: 112 加入日期: 14-2-5 最近的帖子
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,修改在8 年前。

RE: Display number of failed login attempt on jsp

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Liferay counts failed counts in the user record. Number of allowed failures comes from the password policy, so it is somewhat dynamic.
Prateeksha Mandloi,修改在8 年前。

RE: Display number of failed login attempt on jsp

Regular Member 帖子: 112 加入日期: 14-2-5 最近的帖子
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,修改在8 年前。

RE: Display number of failed login attempt on jsp

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在6 年前。

RE: Display number of failed login attempt on jsp

New Member 帖子: 2 加入日期: 17-3-6 最近的帖子
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