I am using a .net 4.5 framework application which i am using as Endpoint i want to add apikey to protect it on environment basis. So In Dev, UAT and Prod Web.Config file (using transform thing to fetch values from primary Web.config file) i want to add a ApiKey and then authorize the controller by that key same way we do it in web api or .net core web api
[AuthorizeByApiKey]
. I checked documentation but in .Net 4.5 can't find a way of doing this. I checed OWIN
library but don't have any idea how i can apply it here
currently i am using following attribute
[System.Web.Http.RoutePrefix("api/address")]
same way i want to use Authorize Attribute and protect every controller by the key
i tried using following attribute but not getting how i can pass Key to this only properties i can add here are Users and Roles
[System.Web.Http.Authorize()]