当前位置: 动力学知识库 > 问答 > 编程问答 >

FBA authorization in custom WCF SharePoint

问题描述:

I have soap WCF SharePoint:

[ServiceContract]

public interface IService

{

[OperationContract]

string Test();

}

[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;

}

}

This service mapped on ISAPI.On SharePoint use FBA. And How connect to WCF that impersonate/authenticate FBA user?

网友答案:

When enable windows and fba authentication order to use windows authentciation need add header "X-FORMS_BASED_AUTH_ACCEPTED" with value "f": I use restsharp:

 request.AddHeader("X-FORMS_BASED_AUTH_ACCEPTED", "f")
分享给朋友:
您可能感兴趣的文章:
随机阅读: