我有肥皂WCF SharePoint:
[ServiceContract]
public interface IService
{
[OperationContract]
string Test();
[OperationContract]
string Test();
}
此服务映射到ISAPI.On SharePoint使用FBA。以及如何连接到冒充/验证FBA用户的WCF?
[BasicHttpBindingServiceMetadataExchangeEndpoint]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class Service : IService
{
public string Test()
{
WindowsIdentity identity = ServiceSecurityContext.Current.WindowsIdentity;
ClaimsIdentity claimsIdentity = new ClaimsIdentity(identity);
return SPContext.Current.Web.Title;
}
}
答案 0 :(得分:0)
当启用windows和fba身份验证命令以使用Windows身份验证时,需要添加值为“f”的标题“X-FORMS_BASED_AUTH_ACCEPTED”:我使用restsharp:
request.AddHeader("X-FORMS_BASED_AUTH_ACCEPTED", "f")