Incorrect Username/Password Combination
Hi there,
We can't login to our Sitefinity 4.1 website.
1. We've checked to make sure that the web.config and the App_data/.../data.config files both point to the correct DB
2. We've created a dummy Aspx page with a login control and attached to the LoginError event. No help there. The error does fire, but no details are given
3. In break mode we created a reference to Sitefinity...UserManager and could successfully get an instance of the user using the GetUser method. We tried ValidateUser and that failed. We then called ResetPassword, which returned a new password (irrespective of the Question Answer provided - i.e. it didn't care about the second parameter). We tried this new password using ValidateUser and it returned true. When we tried this password in the UI it failed. We stopped debugging, started it again and when we tried the new password again using ValidateUser, it didn't work.
We copied the application from our clients server to ours recently, not sure if that makes any difference?
Regards,
Jacques
Hello J.Hoventer,
Can you try creating a new user programatically like this:
var userManager = UserManager.GetManager(
"Default"
);
System.Web.Security.MembershipCreateStatus status;
userManager.Provider.SuppressSecurityChecks =
true
;
var user = userManager.CreateUser(
"user1"
,
"user1234@"
,
"user1@test.com"
,
"Question"
,
"Answer"
,
true
,
null
,
out
status);
user.FirstName =
"FirstName"
;
user.LastName =
"LastName"
;
userManager.SaveChanges();
RoleManager roleManager = RoleManager.GetManager(
"AppRoles"
);
roleManager.Provider.SuppressSecurityChecks =
true
;
var role = roleManager.GetRole(
"Administrators"
);
roleManager.AddUserToRole(user, role);
roleManager.SaveChanges();