问题描述:

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")
相关阅读:
Top