C# 如何在ASP.NET identity中以密码登录时获取身份
我正在使用ASP.NET标识和下面的代码登录用户C# 如何在ASP.NET identity中以密码登录时获取身份,c#,asp.net,asp.net-identity,asp.net-identity-2,C#,Asp.net,Asp.net Identity,Asp.net Identity 2,我正在使用ASP.NET标识和下面的代码登录用户 SignInStatus result = await SignInManager.PasswordSignInAsync(model.EmployeeNo, model.Password, model.RememberMe, shouldLockout: false); 它工作正常,用户已成功登录。但是当我像下面这样检查用户身份时 HttpContext.GetOwinContext().Authentication.User.Identit
SignInStatus result = await SignInManager.PasswordSignInAsync(model.EmployeeNo, model.Password, model.RememberMe, shouldLockout: false);
它工作正常,用户已成功登录。但是当我像下面这样检查用户身份时
HttpContext.GetOwinContext().Authentication.User.Identity
里面没有数据吗?如何在密码登录成功后立即检索用户的身份?明白了。要得到它,只需使用下面的代码
HttpContext.GetOwinContext().Authentication.AuthenticationResponseGrant.Identity