I've been trying to secure my WCF data service by developing a customized per-session authentication mechanism that identifies the client based on multiple criteria. Then I wanna intercept all queries and non-query request based on the result of this authentication. Interception of queries is no problem, but since I may have a lot of tables, I've been looking for a way to intercept all queries all in the same place.
For example instead of
[QueryInterceptor("Entities")]
public Expression<Func<Entity, Boolean> FilterEntities(){
return x=> IsAuthenticated;
}
doing
[QueryInterceptor("*")]
public Expression<Func<T, Boolean> FilterEntities<T>(){
return x=> IsAuthenticated;
} // As a logical description only, of course it won't work as it is
So is there any way to filter all query and non-query requests in WCF data service at all?