以声明模式托管在 Sharepoint 中的 WCF 服务

发布于 2024-11-16 05:53:46 字数 1021 浏览 4 评论 0原文

我有一个在声明模式下为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无法言说的痛 2024-11-23 05:53:46

看起来这个配置可能有一些相关性? SharePoint、WCF 和匿名访问(注释模式 - TransportOnly)

It looks like this configuration may have some relevance? SharePoint, WCF and Anonymous Access (note mode - TransportOnly)

零度° 2024-11-23 05:53:46

WCF 服务支持许多传输选项,但它们并未完全集成到 SharePoint 中

WCF services support many transport options, they are not fully integrated into SharePoint

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文