How to unlock a user if his account is locked

One customer say he can not login. I find it’s account return the below message, how to fix it?

Response Status
Error CodeAuthenticationExceptionMessage This account has been locked

The user may be try to login more than MaxLoginAttempts. But how do i unlock it.

Are using SS Authentication tables?
userAuth, userAuth_Premissions, userAuth_Roles, userAuthProvider and userAuthProvider_items

I don’t find any “lock” on this structure, it might that you’re using ASP.NET Membership instead? And yes, they do have a “lock” feature in their user table (aspnet_Membership table).

just edit the user and put back the FailedPasswordAttemptCount to zero and IsLockedOut to 0 as well.

you can also edit the web.config file and set maxInvalidPasswordAttempts to zero (default is 5).

@balexandre
Hi thanks for replying.
I use SS Authentication and i think SS has lock feature. Please have a look at MaxLoginAttempts.

var af = new AuthFeature(
                () => new BabybusUserSession(), //Use your own typed Custom UserSession type

                new IAuthProvider[]
                {
                    //HTML Form post of UserName/Password credentials
                    new BabybusCredentialsAuthProvider()
                    {
                        SessionExpiry = TimeSpan.FromDays(sessionDays)
                    },
                }
            );
   
            af.MaxLoginAttempts = 2;

True!

There’s a new feature for MaxLoginAttempts.

In the database you can’t find this field?

1 Like

@balexandre
you are right, the lock config in the database. :smiley: thank you very much!!!

update [UserAuth] set LockedDate=null WHERE LockedDate is not null
1 Like