Search code examples
c#.netwcfwcf-securitywsfederationhttpbinding

.Net wsFederationHttpBinding and SAML2.0


OK I have created a SAML Implementation using wsFederationHttpBinding but I do not want to encrypt the soap:Body.

As Specified here http://msdn.microsoft.com/en-us/library/system.servicemodel.wsfederationhttpsecuritymode.aspx

it says the "Message Security Mode" will,

By default, the body is encrypted and signed.

How can you turn off the encryption of the Body?


Solution

  • Actually I found an easier way than creating a custom Binding

    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="Service.IService",
    ProtectionLevel= System.Net.Security.ProtectionLevel.Sign)]
    

    The Protection Level of the Service can tell the wsFederatedHttpBinding weather or not to Sign and Encrypt or just Sign the message.