Reputation: 4596
I have created an web api in .net I have custom authroization filter which check for token before executing the API method.
I want to add a custom attribute in custom authorization filter and get this attribute in every api method.
Custom authorize
public override void OnAuthorization(System.Web.Http.Controllers.HttpActionContext actionContext)
{
}
How to do this.
Thanks
Upvotes: 0
Views: 1070
Reputation: 4596
I solved by adding paramter in like below
Request.Properties.Add("test", "test");
Upvotes: 0
Reputation: 36594
This seems to be well documented here: Authentication Filters in ASP.NET Web API 2
Follow this guide and you can open a new question if you face any particular problem.
Upvotes: 1