As suggested by @ADyson i used Filter.
Here the solution: stackoverflow.com/a/24026535/3061212
this my code:
public class CustomAuthFilter : AuthorizationFilterAttribute
{
public override void OnAuthorization(HttpActionContext actionContext)
{
KeyValuePair<string, string>[] values = (KeyValuePair<string, string>[])actionContext.Request.Properties["MS_QueryNameValuePairs"];
string MyVar = Guid.Parse(values.Where(f => f.Key.Equals("MyVar")).FirstOrDefault().Value);
}
}
[CustomAuthFilter]
public class FastSchedulerController : ApiController
{
[Route("api/FastScheduler/test")]
[HttpGet]
public string test(string id)
{
return id;
}
}