以声明模式托管在 Sharepoint 中的 WCF 服务
我有一个在声明模式下为 Https 配置的共享点服务器。我在 sharepoint 服务器中托管了一个 WCF 服务。此 WCF 服务器使用客户端证书进行身份验证。
WCF 服务使用BasicHttpBinding
。
在客户端,以下是绑定:
BasicHttpBinding binding = new BasicHttpBinding();
binding.TransferMode = TransferMode.StreamedResponse;
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
我还使用以下调用设置了客户端证书:
base.ClientCredentials.ClientCertificate.SetCertificate(
"CN=tempClientcert", StoreLocation.LocalMachine, StoreName.My
);
客户端证书在客户端和服务器中正确设置。
当我尝试调用该服务时,出现以下错误:
System.Security.MessageSecurityException : The HTTP request is unauthorized
with client authentication scheme 'Anonymous'. The authentication header
received from the server was 'NTLM'
虽然我已将客户端凭据设置为证书,但尚不清楚为什么它说 http 客户端身份验证方案是匿名的。
I have a sharepoint server configured for Https in Claims mode. I have hosted a WCF Service in the sharepoint server. This WCF server uses client certificate for authentication.
The WCF service uses BasicHttpBinding
.
On the client side following is the binding:
BasicHttpBinding binding = new BasicHttpBinding();
binding.TransferMode = TransferMode.StreamedResponse;
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Ntlm;
I have also set the client certificate using the following call:
base.ClientCredentials.ClientCertificate.SetCertificate(
"CN=tempClientcert", StoreLocation.LocalMachine, StoreName.My
);
The client certificate is correctly setup in the client and the server.
When I try to invoke the service, I get the following error:
System.Security.MessageSecurityException : The HTTP request is unauthorized
with client authentication scheme 'Anonymous'. The authentication header
received from the server was 'NTLM'
Though i have set the client credential to Certificate, it is unclear as to why it is saying http client authentication scheme is Anonymous.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来这个配置可能有一些相关性? SharePoint、WCF 和匿名访问(注释模式 - TransportOnly)
It looks like this configuration may have some relevance? SharePoint, WCF and Anonymous Access (note mode - TransportOnly)
WCF 服务支持许多传输选项,但它们并未完全集成到 SharePoint 中
WCF services support many transport options, they are not fully integrated into SharePoint