DefaultCredentials オプションと HTTPS に問題があります。HTTP プロトコルを使用する場合はすべて問題ありません - ntlm 認証は問題ありませんが、Thread.CurrentPrincipal の Web サービス側で HTTP を HTTPS に変更すると、何もありません (空の文字列と false 値の IsAuthenticate)。同様の問題がありますか?
私のNtlm構成:
internal class NtlmSelfHostConfiguration : HttpSelfHostConfiguration
{
public NtlmSelfHostConfiguration(string baseAddress) : base(baseAddress) { }
public NtlmSelfHostConfiguration(Uri baseAddress) : base(baseAddress) { }
protected override BindingParameterCollection OnConfigureBinding(HttpBinding httpBinding)
{
httpBinding.Security.Mode = HttpBindingSecurityMode.Transport;
httpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
return base.OnConfigureBinding(httpBinding);
}
}
HttpClient の作成
var handler = new HttpClientHandler() { UseDefaultCredentials = true };
httpClient = new HttpClient(handler);
User-Password Basic 認証は正常に機能しているため、証明書に問題はありません