How to extend AspNetUserLogin in ASP.Net Identity?
When a user logs in with an external login provider like facebook or twitter , I want to store it ExternalIdentity.Name
in the database so that it can be displayed on the user details page.
What I have now:
[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);
...
}
How can I extend / change / override the method SignInManager.ExternalSignIn
to save the table loginInfo.ExternalIdentity.Name
to dbo.AspNetUserLogins
?
+3
source to share
No one has answered this question yet
Check out similar questions: