Quote from the documentation:
By design, the SimpleMembershipProvider class does not implement the
full range of functionality that is possible in ASP.NET membership
providers, as defined in the MembershipProvider class that is used by
all ASP.NET membership providers. Some members are available in the
class because they are inherited from the base class, but will throw
an exception if you access them.
If your website requires the full membership provider capabilities,
you can skip initialization of the Web Pages membership system (that
is, do not call WebSecurity.InitializeDatabaseConnection()) and
instead make sure that the standard membership and role providers are
enabled. In that case, calls that you make to the
SimpleMembershipProvider class are passed through to the standard
provider (which is referred to as the previous provider in the
SimpleMembershipProvider class documentation). For more information,
see Configuring an ASP.NET Application to Use Membership.
The PasswordSalt
field is one of those columns. If you look at the source code of the SimpleMembershipProvider you will notice that the PasswordSalt column is simply set to string.Empty
:
if (database.Execute("INSERT INTO [" + MembershipTableName + "] (UserId, [Password], PasswordSalt, IsConfirmed, ConfirmationToken, CreateDate, PasswordChangedDate, PasswordFailuresSinceLastSuccess) VALUES (@0, @1, @2, @3, @4, @5, @5, @6)", new object[] { num, str, string.Empty, !requireConfirmationToken, obj3, DateTime.UtcNow, num2 }) != 1)
{
throw new MembershipCreateUserException(MembershipCreateStatus.ProviderError);
}
So if you want to use it you could write a custom membership provider that overrides the default one and generate the PasswordSalt yourself. You could override the CreateAccount
method.