Saturday, November 26, 2011

End-to-end vs point-to-point security in WCF

Consider a scenario where a message needs to be send from A to D. The message goes from A to B and from B to C and finally reaches D (from C).

The whole chain of communication from A to D can be called end-to-end. For this to happen we should give protection at message level
in WCF this can be done as follows :-

BasicHttpBinding bind = new BasicHttpBinding();
bind.Security.Mode = BasicHttpSecurityMode.Message


Point-to-Point communcation is what happens from A to B and this is done using transport level security

BasicHttpBinding bind = new BasicHttpBinding();
bind.Security.Mode = BasicHttpSecurityMode.Transport


Alternatively in config files(using wsHttpBinding as example) :-
<wsHttpBinding>
<binding name="TransportSecurity">
    <security mode="Transport" />
       <transport clientCredentialType = "Windows" />
    </security>
</binding>
</wsHttpBinding >

No comments:

Post a Comment