0

I have WCF based services with hundreds of endpoints. These services are not secure. I want to add Token Based Authentication on all end points. Issue is that they are too many of them. so, its hard apply check in every function.

if(authenticated) 
   Return Response
else 
   Return UnAuthorizedError

Is there any way i can use to get it done with minimal code changes. Something like ActionFilterAttribute, IAuthenticationFilter in MVC.

I have searched for it. But could't find this specific scenario. As there are too many endpoints to change.

Fazal Wahid
  • 175
  • 2
  • 17
  • 1
    Like ASP.Net, WCF has many extensibility points. You probably want to implement a MessageInspector behavior that you can apply via configuration. I don't remember how well enough to write an answer but that should narrow your research. – Crowcoder Jun 17 '17 at 11:35

1 Answers1

-1

You should implement your own MessageInspector. Please look at this SO answer to have inspiration of how to do that on both client and server side.

Igor Labutin
  • 1,406
  • 10
  • 10