GetOwinContext does not work in asp.net core

He always says that HttpContext does not include the definition of GetOwinContext (), I am trying to load .net core owin, but I do not know how to implement the same function. Code scripts can be run in asp.net 5.

private IAuthenticationManager AuthenticationManager
{
    get
    {                
        return HttpContext.GetOwinContext().Authentication;
    }
}
+8
source share
2 answers

There is no Asp.Net kernel GetOwinContext(). HttpContext.Authenticationuse it HttpContext.Authentication.

+7
source
   private IAuthenticationManager Authentication
        {
            get { return Request.GetOwinContext().Authentication; }
        }

Use HttpRequestMessage instead of HttpContext.

-2
source

Source: https://habr.com/ru/post/1651746/


All Articles