I need access to a valid instance of a AuthenticationManager outside of a controller. For example, in a custom AuthroizeAttribute. In the template used to create an MVC 5 application that uses ASP.NET Identity it creates this code in the AccountController to create an instance of a AuthenticationManager.
private IAuthenticationManager AuthenticationManager
{
get
{
return HttpContext.GetOwinContext().Authentication;
}
}
This HttpContext is a property of the Controller. How do I create an AuthenticationManager that has the correct context if I am not in a controller?
I am having a hard time finding any good documentation on ASP.NET Identity and OWIN.