Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to change the password of a User (not Member) in a UserControl but it does not seem to be working.
I found this post http://our.umbraco.org/forum/developers/api-questions/10247-Is-MemberShipHelper-out-of-45 and used the same / similar code but the password doesn't change ... ?
Hi Gordon,
If I remember correctly you can get the user from the membership provider and update the password directly, much like this:
MembershipUser user = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].GetUser("login", true);
user.Password = "newpassword";
user.Save();
Grtz
L
OK ... problem solved!
The issue was that the password was not being hashed when assigned / saved. The above code is one option I tried but the password was entered into the database as plain text. The solution was found here http://our.umbraco.org/wiki/reference/api-cheatsheet/users,-user-types-and-permissions/add-user-with-hashed-password
I have implemented similar code and it appears to work fine!
var u = new User(LoginName); u.Password = HashPassword(newPwd); u.Save();
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Change User password via API
I am trying to change the password of a User (not Member) in a UserControl but it does not seem to be working.
I found this post http://our.umbraco.org/forum/developers/api-questions/10247-Is-MemberShipHelper-out-of-45 and used the same / similar code but the password doesn't change ... ?
Hi Gordon,
If I remember correctly you can get the user from the membership provider and update the password directly, much like this:
MembershipUser user = Membership.Providers[UmbracoSettings.DefaultBackofficeProvider].GetUser("login", true);
user.Password = "newpassword";
user.Save();
Grtz
L
OK ... problem solved!
The issue was that the password was not being hashed when assigned / saved. The above code is one option I tried but the password was entered into the database as plain text. The solution was found here http://our.umbraco.org/wiki/reference/api-cheatsheet/users,-user-types-and-permissions/add-user-with-hashed-password
I have implemented similar code and it appears to work fine!
is working on a reply...