I am writing simple REST service for leaning vNext and new MVC. I want to understand how to create a simple OWIN authorization with custom logic. For example, imagine that a service has just a simple in-memory list of tokens and I want to check that a request contains token that exist in that list.
If I understood properly, I just need to override AuthorizeAttribute class, but I cannot find how to do this in the right way.
public class CustomAuthorize : AuthorizeAttribute
{
public override Task OnAuthorizationAsync(AuthorizationContext context)
{
return base.OnAuthorizationAsync(context);
}
}
If I misunderstood this, could you please explain what classes I need to use and can I do it.