3

We have a 3 tier application - winform based thick client, several WCF services hosted in windows services and sql. Some WCF services provide functionalities specific to UI in the clients but there are services running to do data loading, processing, caching etc. So, all these services talk to each other and also serve requests from clients.

Now comes the actual question : Is there a way to understand if a request is from a client or from another service. Assuming I write a message inspector, can I somehow interpret, if a request is coming through from a client (user) or from another service.

What I am trying to achieve - This is in another thread if you need. stopping user requests to wcf services. But briefly, am trying to keep the services locked from user access but the services should continue to run and be accessible to/from other services.

Community
  • 1
  • 1
Everything Matters
  • 2,672
  • 4
  • 25
  • 42

1 Answers1

2

Is there a way to understand if a request is from a client or from another service. Assuming I write a message inspector, can I somehow interpret, if a request is coming through from a client (user) or from another service.

That is a task for authentication and authorization. Your clients will have accounts in Clients group and your services will have accounts in Services group. You will also probably need some custom ServiceAuthorizationManager which will check if clients are allowed to access the service and either pass them in or throw exception.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • No. The scenario here is different. It is totally not related with authorization. Refer to the link for some explanation on the scenario. Hopefully it helps. – Everything Matters Jul 05 '11 at 08:47
  • 1
    I read that link and it doesn't matter. You want to know if the request is from service or client - you want authentication. You want to deny the client to access the service - you want authorization. Call it as you want but that is what you need. You will either use built in stuff or you will add some magic field to each request and you will do it manually. Or you will have separate service for clients and for services and you will simply stop the host for client service if you need to. – Ladislav Mrnka Jul 05 '11 at 08:53
  • Yes, that seemed to help. looking through this to see how to implement what I need in here. Thank you. – Everything Matters Jul 07 '11 at 08:52