Hi,
I am trying to authenticate calls to a WCF DataServices service via Silverlight. Essentially, when a user logs in they get a special hash which should be embedded in the headers of every request to the WCF DataServices. Currently use this as a check via a QueryInterceptor method eg
[QueryInterceptor("Orders")]
public Expression<Func<Orders,bool>> OnQueryOrders()
{
string hash = WebOperationContext.Current.IncomingRequest.Headers.Get("MyHeader");
if(!TestHash(hash))
{
return o => false;
}
else
{
return o => true;
}
}
This seems like the WORST way to achieve this. Is there any hook in WCF Dataservices the runs before a query is run that you can use to cancel a request? Bear in mind this service is stateless and has no access to session.