Is it possible to access post or get parameters via the HttpActionContext object?
I have a set of sensors that loggs data to a web server that provides a REST api.
I accessed the context route data to get the parameters from within a custom AuthorizeAttribute when calling something like /api/client/123/users:
public class CustomAuthorizeAttribute : AuthorizeAttribute
{
protected override bool IsAuthorized(System.Web.Http.Controllers.HttpActionContext actionContext)
{
var clientId = Convert.ToInt32(actionContext.ControllerContext.RouteData.Values["clientid"]);
// Check if user can access the client account.
}
}