如何在ASP .Net Identity中扩展AspNetUserLogin?

时间:2014-12-02 12:02:28

标签: c# asp.net asp.net-identity

当用户使用外部登录提供商(例如 facebook twitter )登录时,我想将他的ExternalIdentity.Name保存到数据库以显示其用户详细信息页。

我现在拥有的:

[AllowAnonymous]
public ActionResult ExternalLoginCallback(string returnUrl)
{
    var loginInfo = AuthenticationManager.GetExternalLoginInfo();
    if (loginInfo == null)
        return RedirectToAction("Details", new { message = "LinkLoginError" });

    // Sign in the user with this external login provider if the user already has a login
    var result = SignInManager.ExternalSignIn(loginInfo, isPersistent: false);
    ...
}

如何扩展/修改/覆盖SignInManager.ExternalSignIn方法以将loginInfo.ExternalIdentity.Name保存到dbo.AspNetUserLogins表?

0 个答案:

没有答案