I am prototyping a WCF service with a custom authorization policy. The service ran fine until I set principalPermissionMode = "Custom" and implemented the evaluate method of my IAuthorizationPolicy. Now it throws an exception when a client tries to get the metadata.
I have seen various posts that talk about trapping these calls and I can successfully trap them by looking for
operationContext.IncomingMessageHeaders.Action == "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get/"
But what do I do once I trap them? Regardless of whether I return true or false from the evaluate method I still get the exception.
Do I need to do something else before my IAuthorizationPolicy so that evaluate never gets called?