Im new to umbraco and currently faced with below issue.
I have a requirement to validate for the existence of umbraco backoffice users (users in umbracoUser table) inside a SurfaceController by using a user entered username and a password, and this is what I have done so far.
var result = new Umbraco.Web.Security.Providers.UsersMembershipProvider().ValidateUser(username, password);
When I used the above statement to validate with existing username and a correct password, it always returns false and locks the user by setting a DateTime value to lastLockoutDate column and userNoConsole = 1
in umbracoUser table.
Looked into below post as well, but it did not help.
https://our.umbraco.com/forum/umbraco-cloud/76499-umbraco-7-user-login-backoffice-programmatically
Any guidance on how to validate the existence of back office users programmatically would be a big help.
I found a way to validate the back office users successfully, via the below code.
In the Web.config, I found back office membership provider information.
So, I used membership providers name and did the below to validate backoffice users,
The above validates the backoffice users returns true if they exist.