wcfwcf-securitymtom

WCF Service - MTOM Security modes & transport/message property's values


Could you please let me know, how/what to set the Mode and ClientCredentialType property in configuration for MTOM-basicHttpBinding.

For ANONYMOUS authentication- Below configuration is working fine

<security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
</security>

Could you please help me to understand what should the values against each attribute for NTLM and Windows authentication types for Mtom binding?

Thanks,


Solution

  • Both the below security modes support Windows/NTLM authentication and MTOM encoding.

    Uri uri = new Uri("https://localhost:21011");
      BasicHttpBinding binding = new BasicHttpBinding();
                binding.MessageEncoding = WSMessageEncoding.Mtom;
                binding.Security.Mode = BasicHttpSecurityMode.Transport;
                binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
                // NTLM
                //binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
    

    Or,

    Uri uri = new Uri("http://localhost:21011");
                BasicHttpBinding binding = new BasicHttpBinding();
                binding.MessageEncoding = WSMessageEncoding.Mtom;
                binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
                binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
    

    Feel free to let me know if the problem still exists.