I use the membership API with the OpenId implementation in my MVC2-based project. In addition to the username, I need other fields that will be associated with the user during registration.
I'm not sure though, but I think the asp.net profile system is built for this type of requirement. In addition, I see a table with other membership tables called "aspnet_profile".
I added the following parameters to the web.config application to enable the profile:
<profile enabled="true">
<properties>
<add name="FullName" allowAnonymous="false"/>
</properties>
</profile>
As already mentioned, the application requires several additional data that must be associated with the user, so when creating a user using the membership API, I added a few more lines of code to enter the profile table
System.Web.Security.MembershipCreateStatus status = MembershipService.CreateUser(userModel.UserName, userModel.Password, userModel.UserName);
if (status == System.Web.Security.MembershipCreateStatus.Success)
{
FormsService.SignIn(userModel.UserName, true);
Session["Username"] = userModel.UserName;
dynamic profile = ProfileBase.Create(MembershipService.GetUser(userModel.UserName).UserName);
profile.FullName = userModel.UserFullName;
profile.Save();
RedirectToAction("Tech", "Home");
}
, aspnet_profile . , , .