O'Reilly logo

Expert ASP.NET Web API 2 for MVC Developers by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 24

image

Filters Part II

In this chapter, I continue describing the Web API support for filters and demonstrate how authorization filters work. I also show you two kinds of special filters: exception filters and override filters. Table 24-1 summarizes this chapter.

Table 24-1. Chapter Summary

Problem

Solution

Listing

Create an authorization filter.

Implement the IAuthorizationFilter interface, derive from the AuthorizationFilterAttribute class, or use the Authorize attribute.

1, 5–9

Restrict access to an action method.

Apply an authorization attribute to the action method or its containing controller.

2–4

Handle an exception thrown by an action method ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required