I have a scenario where my WCF service is hosted but should return different response to different clients and also different security/authentication options.
How to implement that ? Idea and small model code would be appreciable.
Client A and Client B suppose consumes the service. Client A should be given some data and Client B should be given some other data and also both of them should have different access rights/permissions….
Thank you…
There’s a lot of ways to do this; bottomline is you have to identify the user that’s connecting. This can be done using an X509 client certificate, HTTP (basic/digest) authentication or a custom API key (or credentials) that the client sends during each request (in the HTTP headers, in the message headers or simply in a field in the message body).
Once you’ve got that part figured out, you can let your code decide what to do based on who’s making the request.