Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Importing users from aspnet membership tables - problem with passwordSalt View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
lucyht - 6/29/2012 8:34:51 AM
   
Importing users from aspnet membership tables - problem with passwordSalt
The import tool does a great job allowing you to map user data from an existing database to a kentico one with one exception. That is mapping the password salt. The Kentico documentation says that the user's GUID will be used as the salt, but our existing membership database (standard aspnet membership) has a separate passwordSalt field.

I can create a system field to import the passwordSalt to, but how can I then get Kentico to use this salt as opposed to the GUID - only for this site as well?

Has anyone else cracked this one? I really don't fancy having to reset everyone's passwords!

PS Kentico v6.0.36 SP1

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/10/2012 6:10:57 AM
   
RE:Importing users from aspnet membership tables - problem with passwordSalt
Hello,

I've checked with our developer and this requires some customization. If you have the source code license, then this is achievable within a few minutes. However, without it, you need to create your own UserInfoProvider.SetPassword method, because we are using the GUID as salt within this method directly.

EDIT: I've got an update from our developer, that the GetPasswordHash method, which is in this case is used and which causes the additional troubles during customization, will be transformed to a public one. That way you can simply override it and use any custom salt value. This method will be updated with the next hotfix or the one afterwards, depending on the workload of the developer.

Best regards,
Boris Pocatko

User avatar
Certified Developer v7
Certified  Developer v7
lucyht - 7/16/2012 6:18:10 AM
   
RE:Importing users from aspnet membership tables - problem with passwordSalt
Thanks for the updated Boris. I did look at importing the PasswordSalt but could not get the override to work in my custom authentication event handler. For now I have imported all the users and used a custom authentication event handler to call a web service to authenticate them against the existing user store. It would definitely be good to be able to import all the user info into Kentico though so we can pension off the old database.

Cheers,
Lucy

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 7/16/2012 8:20:24 AM
   
RE:Importing users from aspnet membership tables - problem with passwordSalt
Hello,

I've checked the latest hotfix (40) and the GetPasswordHash method was changed to be a public one, so, this should work without problems:


/// <summary>
/// Returns the hashed password representation (is hashing on).
/// </summary>
/// <param name="password">Password to hash</param>
/// <param name="passwordFormat">Format of the password</param>
public static string GetPasswordHash(string password, string passwordFormat)
{
return GetPasswordHash(password, passwordFormat, null);
}

Where did you encounter issues?

Best regards,
Boris Pocatko