Hi Daniel,
I had not thought about that and now viola - with the policy element taken
out of the WSDL manually, the NTLM works even without a
"jcifs.Config.registerSmbURLHandler()" under JDK 1.5. So is there a way to
get CXF to work with the Policy tags as is in the WSDL? I got the following
test code on the WCF side:
public static void Main(){
Uri baseAddress = new Uri("http://localhost/cxfTest");
using (ServiceHost host = new ServiceHost(typeof(Service1), baseAddress))
{
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
host.Description.Behaviors.Add(smb);
BasicHttpBinding httpBinding = new BasicHttpBinding();
httpBinding.Security.Mode =
BasicHttpSecurityMode.TransportCredentialOnly;
httpBinding.Security.Transport.ClientCredentialType =
HttpClientCredentialType.Windows;
host.AddServiceEndpoint(typeof(IService1), httpBinding, baseAddress);
host.Credentials.UserNameAuthentication.UserNamePasswordValidationMode =
UserNamePasswordValidationMode.Windows;
host.Open();
Console.WriteLine("Service running at {0}", baseAddress);
Application.Run();
host.Close();
}
}
Which adds the policy tags in WSDL as:
<wsp:Policy wsu:Id="BasicHttpBinding_IService1_policy">
<wsp:ExactlyOne>
<wsp:All>
<http:NegotiateAuthentication
xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http" />
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
When this tag is manually commented out and the references to it removed,
then CXF was happy and the WCF service was also able to pick up the NTLM
context at OperationContext.Current.ServiceSecurityContext.WindowsIdentity.
But keeping the WSDL with the Policy tag produces the original exception.
--
View this message in context:
http://cxf.547215.n5.nabble.com/NTLM-security-between-WCF-and-CXF-tp4763671p4779559.html
Sent from the cxf-user mailing list archive at Nabble.com.