By: Pawel Pietrzynski named 15 Mar 2019 at 10:20 a.m. CDT

7 Responses
Pawel Pietrzynski gravatar
When working through the Basic with Lockout code if unlock_and_authenticate: self.unLockUser(user_name) self.setUserAttributeValue(user_name, self.invalidLoginCountAttribute, StringHelper.toString(0)) logged_in = authenticationService.authenticate(user_name, user_password) There is no post-processing logic that checks if that newly unlocked user fails a try and increments the counter, perhaps by adding if not logged_in: self.setUserAttributeValue(user_name, self.invalidLoginCountAttribute, StringHelper.toString(1)) The subsequent issue is if lockout threshold is '0' invalid logins then re-locking logic should be triggered. Ideally this should be re-worked into calling the lockout processing function again as a method.

By Sahil Arora user 18 Mar 2019 at 7:59 p.m. CDT

Sahil Arora gravatar
Hi Pawel, If I understand your statement correctly, counter is not incremented for a newly unlocked user which allows user additional try after unlock. I tried to reproduce at my end, but I can see user is allowed only 3 wrong password attempts after unlock. Here are the steps I followed: 1. Enabled Basic Lock Authentication script 2. Provided invalid password 3 times, and user account was locked 3. Wait for lock expiration, and tried again with invalid password. 4. User account was locked after 3 attempts. Let me know if I misunderstood your statement, and provide screen shots of your attempts if possible. Thanks

By Yuriy Movchan staff 19 Mar 2019 at 1:11 a.m. CDT

Yuriy Movchan gravatar
Hi Pawel, We added update based on your comment: https://github.com/GluuFederation/community-edition-setup/commit/31fb43ddf5a737d048ba34a7ad35d95ac4485f7e Regards, Yuriy

By Pawel Pietrzynski named 19 Mar 2019 at 12:20 p.m. CDT

Pawel Pietrzynski gravatar
Hi, I get different results. Please do exactly what I do to demonstrate: Here are my failed messages: * FRESH START (user just logged out): * INPUT BAD CREDENTIALS (1) * 2 more attempt(s) before account is LOCKED! * INPUT BAD CREDENTIALS (2) * 1 more attempt(s) before account is LOCKED! * INPUT BAD CREDENTIALS (3) * Your account is locked. Please try again after 30 secs (DURING LOCKOUT PERIOD) * INPUT ANY CREDENTIALS * Failed to authenticate. * INPUT GOOD CREDENTIALS * Failed to authenticate. (WAIT TO UNLOCK TO PASS) * INPUT BAD CREDENTIALS (1) * Failed to authenticate. * INPUT BAD CREDENTIALS (2) * 2 more attempt(s) before account is LOCKED! * INPUT BAD CREDENTIALS (3) * 1 more attempt(s) before account is LOCKED! * INPUT BAD CREDENTIALS (4) * Your account is locked. Please try again after 30 secs (WAIT TO UNLOCK TO PASS) * INPUT GOOD CREDENTIALS * Login successful ... ALSO, on a side issue ... after you login it does not clear the invalid count, so if you login then logout the invalid counter should reset. FRESH START (user just logged out) * INPUT BAD CREDENTIALS * 2 more attempt(s) before account is LOCKED! * INPUT GOOD CREDENTIALS * Login successful ... * LOGOUT * Logged Out * INPUT BAD CREDENTIALS * 1 more attempt(s) before account is LOCKED! * INPUT BAD CREDENTIALS * Your account is locked. Please try again after 30 secs Sorry for all those edits ... the formatting made the steps listing really tricky and I wanted to make sure it was clear since I was pasting from ASCII. Hope that helps!

By Sahil Arora user 05 Apr 2019 at 7:28 p.m. CDT

Sahil Arora gravatar
Hi Pawel, We have modified the script, Can you please use [this](https://github.com/GluuFederation/community-edition-setup/blob/31fb43ddf5a737d048ba34a7ad35d95ac4485f7e/static/extension/person_authentication/BasicLockAccountExternalAuthenticator.py) script and let us know the results.

By Pawel Pietrzynski named 16 Apr 2019 at 2:28 p.m. CDT

Pawel Pietrzynski gravatar
The script seems to work well for the lockout. However it does not address the scenario where a user has failed several attempts and then succeeded so his attempts should be wiped out since it's "consecutive attempts" we are worried about, not total attempts. So the user invalid login count should be reset after each successful authentication.

By Yuriy Movchan staff 23 Apr 2019 at 2:48 p.m. CDT

Yuriy Movchan gravatar
I understand you. Can you try same script with small [update](https://github.com/GluuFederation/community-edition-setup/commit/a7f334d94137ae271c9720379d8c7e687512d6fc).

By Pawel Pietrzynski named 24 Apr 2019 at 7:49 a.m. CDT

Pawel Pietrzynski gravatar
Works well now, thank you!