You can access GetOwinContext ().GetUserManager fr

2019-06-08 08:44发布

I'm doing a project in a api, and I need to access from the ApiController class to:

var result = await SignInManager.PasswordSignInAsync (model.UserName,model.Password...

but I have access neither
HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>() nor

Request.GetOwinContext().GetUserManager<ApplicationUserManager>();

Basically I need to check that the username and password are correct.

EDIT: I have reference to microsoft.owin.host.SystemWeb and in ConfigureAuth app.CreatePerOwinContext();

1条回答
孤傲高冷的网名
2楼-- · 2019-06-08 09:07

I've already solved, were missing from usings;

using System.Net.Http;
using Microsoft.AspNet.Identity.Owin;

thank you everyone.

查看更多
登录 后发表回答