WCF Service Data Authorization Policy

I am using WCF Data Service and I need to implement authorization policies. Policies are dynamic and stored in a table containing the target table, field, and valid value. For this I am overriding the OnStartProcessingRequest DataService method, but I am trying to change the RequestUri, I am facing the "Unauthorization" problem. Is there a way to change the RequestUri parameter in the OnStartProcessingRequest method?

this code generates exeption

protected override void OnStartProcessingRequest(ProcessRequestArgs args) {
    Uri uri = new Uri(args.RequestUri + "?$filter=Id eq 3");
    args.RequestUri = uri;
}

      

I cannot use Interceptor because the system is dynamic and the entites are unknown.

The decision is currently made to apply filters in the client application (html5 / js) and check the filtering parameters on the server (in OnStartProcessingRequest).

I wonder if there is a way to add filter parameters to OnStartProcessingRequest or in any way that might solve this problem.

+3


source to share





All Articles