Secure a Web API

You want to extend the default authentication mechanism of Web API. You want to have an attribute that you can place on a couple of action methods to log nonauthenticated requests. What do you do?

Inherit from IAuthorizationFilter to implement the custom logic.
Inherit from AuthorizeFilterAttribute to implement the custom logic.
Inherit from AuthorizeAttribute to implement the custom logic.
Create an HttpMessageHandler that you attach to specific routes.