Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF behavior evaluation order and ServiceAuthorizationBehavior

According this article in MSDN, the evaluation order of WCF behaviors is:

  1. Contract
  2. Operation
  3. Endpoint
  4. Service

I have a service that uses a ServiceAuthorizationManager class to perform some custom security validation for requests. This authorization manager is hooked into a ServiceAuthorizationBehavior which implements IServiceBehavior.

I also have custom behavor defined that implements IEndpointBehavior.

According the order above, endpoint behaviors are supposed to be evaluated before service behaviors, however, logging proved otherwise. The ServiceAuthorizationBehavior was being evaluated before the endpoint behavior.

Is this a bug? What is going on here?

Thanks, Mohammed

like image 924
Mohammed Ali Avatar asked Apr 21 '26 09:04

Mohammed Ali


1 Answers

The documentation is incorrect. The actual order is

  1. Service
  2. Contract
  3. Endpoint
  4. Operation

Thanks for pointing this issue, I'll notify the documentation team to have this fixed.

like image 120
carlosfigueira Avatar answered Apr 24 '26 12:04

carlosfigueira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!