How to dynamically choose the action filter to execute for a Web API Action?

323 views Asked by At

I have a API Action that will get requests from two different clients and these two clients will have different authentication mechanisms.

For these two authentication mechanisms I have implemented two action filters. Now I will add these action filters in the API action which will return the same data to both the clients.

I want the code to dynamically choose between the two action filters with respect to the clients. How can I do this ?

I got the below solution. This will go into both action and will check the client and ignore further process whichever is not needed.

http://forums.asp.net/t/1570772.aspx

But I am not sure if this is the only way or do we have a better way for this.

Thanks, R. Venkatesan

0

There are 0 answers