I am using web api 2.0 and c# in the server side of my application.
I want to create a custom filter (autorization filter i guess) to only authorize post/put requests that are coming from allowed referrers (that i define) and block all other requests.
EDIT: to explain more: I need a good and way to see if Request.Header.Referrer exists in the list of referrers i predefined to allow request, otherwise i bloc it and don't authorise method to be executed
Do i use AuthorizationFilter? why? and how? or do i need other type of filters like OperationFilter or others?
If you may explain to me in addition what the main differences that make me choose to work with this type of filter not another...
I searched for that in google but all i found is detailed very large implementation but i still don't see the difference between the most popular (used) type of filters and the reason on what we base our choices on.
Thanks in advance
EDIT: I tried to implement CORS but the problem is that CORS doesn't bloc requests like mentioned in this post... and the solution given is too much for a simple need like mine