Get ExtraData from MVC5 framework OAuth/OWin identity provider with external auth provider

前端 未结 7 1979
旧巷少年郎
旧巷少年郎 2020-11-30 20:22

I\'m trying to use the new MVC5 framework in VS 2013 preview.

The membership authentication framework has been overhauled and replaced with OWin.

<
相关标签:
7条回答
  • 2020-11-30 21:15

    With RTW version of asp.net identity the following code in ExternalLoginCallback does that for me.

    var externalIdentity = await HttpContext.GetOwinContext().Authentication
        .GetExternalIdentityAsync(DefaultAuthenticationTypes.ExternalCookie);
    var displayName = externalIdentity.Name;
    var email = externalIdentity.FindFirstValue(ClaimTypes.Email);
    
    0 讨论(0)
提交回复
热议问题