I have configured SimpleMembership
to use my own table for user data, the Occupant
table, as follows:
WebSecurity.InitializeDatabaseConnection("EstatesContext", "Occupant", "Id", "UserName", autoCreateTables: true);
And in the register event, pass data for this table like so:
WebSecurity.CreateUserAndAccount(
model.UserName,
model.Password,
propertyValues: new {
IdNumber = model.IdNumber,
Surname = model.Surname,
FirstName = model.FirstName,
Type = model.Type,
IsActive = model.IsActive,
EMailAddress = model.EmailAddress
});
When I try and register a new user, I get the following error:
Cannot insert the value NULL into column 'Password', table 'XTimeEstates.dbo.Occupant'; column does not allow nulls. INSERT fails.
Does SimpleMembership
hash and store the password passed to CreateUserAndAccount
elsewhere? Meaning I should not explicitly store any password data? Or is something else wrong?