Detect failed login attempts

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
MrBlack
Posts: 1
Joined: Sat Apr 03, 2021 6:53 am

Detect failed login attempts

Post by MrBlack »

Hello,

I am new to the forum, but read a lot through it, which helped me solve several problems already. Thanks!

I am trying to detect bad login attempts and found the InvalidUsernameOrPasswordException() class, but can't catch the exception. The idea would be to somehow disable the user after three failed attempts.

Thank you in advance for your help.

Code: Select all

void btnLogin_Click(System.Object sender, System.EventArgs e)
{
	try
	{
		Globals.Security.Login("User1", "2");		// 2 is not the password for User1
	}
	catch (InvalidUsernameOrPasswordException)
	{
		Globals.Tags.ExceptionHappened.SetTag();	// Tag not set altough login failed
	}
}

Post Reply