Development Experience

Monday, February 5, 2018

ASP.NET Web API IP Filter

If you need to restrict an access to your some of the web controllers
it is safer to do with help of Asp.net web api filters.

The web api filters allows you to do several operations at OnActionExecuting stage.
You can block some requests and return 403 if you wish so. 

I found RANDY BURDEN'S blog he has a nice implementation of a IP Filter for MVC.
I converted this code a bit which can be used in Asp.net Web API.

No comments:

Post a Comment