User614698185 posted
Hi Rainmater,
OAuth doesn’t care where or how you manage your user account information. It’s ASP.NET Identity which is responsible for it.
When the user clicks the Register button, the Register action of the Account controller creates the user by calling the ASP.NET Identity API, as below:
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Register(RegisterViewModel model)
{
if (ModelState.IsValid)
{
var user = new ApplicationUser() { UserName = model.UserName };
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
await SignInAsync(user, isPersistent: false);
return RedirectToAction("Index", "Home");
}
else
{
AddErrors(result);
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
For more information, please refer to the following documentations:
http://www.asp.net/identity/overview/getting-started/introduction-to-aspnet-identity
http://www.asp.net/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server
Best Regards,
Candice Zhou