I have multiple routes for my API like
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{token}/{controller}/{action}",
defaults: null,
constraints: null,
handler: HttpClientFactory.CreatePipeline(
new HttpControllerDispatcher(config),
new DelegatingHandler[] { new ApiTokenValidator() })
);
config.Routes.MapHttpRoute(
name: "LoginApi",
routeTemplate: "api/{controller}/{action}",
defaults: null,
constraints: null,
handler: HttpClientFactory.CreatePipeline(
new HttpControllerDispatcher(config),
new DelegatingHandler[] { new ApiLoginHandler() })
);
How can I make sure that a method in my APIController only can be used by for example the LoginApi route/handler?