if (Members.Login(model.Username, model.Password)) - true before, now false
I have created a Surfacecontroller using the following method:
// Umbracos own built-in loginmodel is used
public ActionResult Login(Umbraco.Web.Models.LoginModel model)
{
if (model.Username == null)
ModelState.AddModelError("", "Brukernavn må fylles ut");
if (model.Password == null)
ModelState.AddModelError("", "Passord må fylles ut");
if (Members.Login(model.Username, model.Password)) << Redirect to turmaal if true.
return Redirect("/turmaal");
ModelState.AddModelError("", "Ugyldig innlogging");
return CurrentUmbracoPage(); << Redirect to current page if false.
}
After I had problems with my older site upgraded evenly from long time ago, up to Umbraco ver 7.6.2, I've now created a whole new site with Umbraco ver 7.6.4.
I've saved a member with the same username and password, but if (Members.Login (model.Username, model.Password)) is now false and not true as before (will now not redirect to "/turmaal" as before).
I can't longer log me in as a authenticated Member. I've tried Members.IsLoggedIn(), but this give me false too.
Someone who knows where the difference on these two site can be?
Assuming there's a setting that needs to be checked, but which?
But when using member data from a version before 7.6 the password hashing is based on another algoritm where it's likely that you need to use:
useLegacyEncoding="true"
And in case the length of the members passwords could have been smaller than 10, also change the value for minRequiredPasswordLength to match the minimum length used.
Thank you for the answer. That was the solution. I forgot to mention that I'm using SQL Compact Edition, so it's a new database and creation of new members.
I changed myRequiredPasswordLength to what I had before, but I think I changed useLegacyEncoding to true before creation of new members. When I deleted all test members, changed useLegacyEncoding to false again, created new members, and members can now log in as in the previous solution. :-)
if (Members.Login(model.Username, model.Password)) - true before, now false
I have created a Surfacecontroller using the following method:
After I had problems with my older site upgraded evenly from long time ago, up to Umbraco ver 7.6.2, I've now created a whole new site with Umbraco ver 7.6.4.
I've saved a member with the same username and password, but
if (Members.Login (model.Username, model.Password))
is now false and not true as before (will now not redirect to "/turmaal" as before).I can't longer log me in as a authenticated Member. I've tried
Members.IsLoggedIn()
, but this give me false too.Someone who knows where the difference on these two site can be?
Assuming there's a setting that needs to be checked, but which?
Hi Tom,
Did you copy member data from the database of the "old" Umbraco version to the database of the new fresh install?
If yes, can you check your UmbracoMembershipProvider in web.config?
Fresh installs will have:
But when using member data from a version before 7.6 the password hashing is based on another algoritm where it's likely that you need to use:
And in case the length of the members passwords could have been smaller than 10, also change the value for minRequiredPasswordLength to match the minimum length used.
Thank you for the answer. That was the solution. I forgot to mention that I'm using SQL Compact Edition, so it's a new database and creation of new members.
I changed
myRequiredPasswordLength
to what I had before, but I think I changeduseLegacyEncoding
to true before creation of new members. When I deleted all test members, changeduseLegacyEncoding
to false again, created new members, and members can now log in as in the previous solution. :-)is working on a reply...