【发布时间】:2011-06-03 16:59:08
【问题描述】:
我有一个运行 WCF Net Tcp 绑定服务的 Windows 服务。所有绑定和端点信息都以编程方式设置。
_host.AddServiceEndpoint(typeof(IService), new NetTcpBinding(), serviceName);
在 sharepoint 中,我使用通道工厂访问此服务:
var channelFactory = new ChannelFactory<IService>(
new NetTcpBinding(),
new EndpointAddress(new Uri(connectionUrl))
);
return channelFactory.CreateChannel();
此代码使用 SharePoint 2007 运行良好。现在我们正在将 SharePoint 网站升级到 2010,基于表单的新声明身份不会发送客户端凭据。我收到此错误。
System.IdentityModel.Tokens.SecurityTokenValidationException, System.IdentityModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
The service does not allow you to log on anonymously.
有谁知道如何让 Channel Factory 发送应用程序池的凭据?现在我已经通过使用 RunWithElevatedPrivileges 解决了我的问题,但我并不热衷于这样做,除非我别无选择。
【问题讨论】:
标签: wcf sharepoint-2010 claims-based-identity claims net-tcp