WCF includes support for establishing a security session through a simple configuration attribute. The primary reason of a security session is a shared security context which enables clients and services to use a faster, symmetric cryptographic exchange. WCF sessions should not be thought of in terms of HTTP based sessions, since the former are initiated by clients and the latter by the servers. In other terms, WCF sessions are there to support some kind of shared context between a particular client and a service. This context can be anything, and is not limited to security contexts. The attribute that establishes a security session and shared context is called, well, establishSecurityContext and is present in binding configuration. An example of such a binding would be: <bindings> <wsHttpBinding> <binding name="SecureBinding"> <security mode ="Message"> <message clientCredentialType="Certificate" establishSecurityContext="true"/> </security> </binding> </wsHttpBinding> <bindings> This binding allows HTTP based communication, demands message based security (think WS-Security) and uses certificates to sign/encrypt the message content. The attribute establishSecurityContext is set to true , which actually enforces a WS-SecureConversation session between the client and the service. The following is a simplified version of what is going on under the covers: Client instantiates the service proxy No message exchange is taking place
Read More...