C# 从Windows应用商店应用程序使用Windows身份验证调用WCF服务
我有一个WCF服务部署到本地机器上的IIS,配置为Win AuthC# 从Windows应用商店应用程序使用Windows身份验证调用WCF服务,c#,wcf,authentication,windows-store-apps,C#,Wcf,Authentication,Windows Store Apps,我有一个WCF服务部署到本地机器上的IIS,配置为Win Auth <basicHttpBinding> <binding name="NewBinding0"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" /> </security> </bindin
<basicHttpBinding>
<binding name="NewBinding0">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
但如果我简单地说
clientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
我得到以下错误
{HTTP请求未经客户端身份验证方案“Ntlm”授权。从服务器收到的身份验证标头为“协商,Ntlm”。}
我已经配置了企业身份验证和专用网络客户端和服务器功能
我需要做什么才能在登录域用户的上下文中调用该服务
我已经找到了可能是同一个问题的答案,但还没有答案 原来问题是我在笔记本电脑上托管测试服务,并使用“localhost”调用它的结果 我已经将相同的服务部署到我们域上的另一台服务器上,并在应用程序中更新了端点地址,一切都很好 似乎对本地主机上的windows应用商店应用程序调用服务有限制 不太清楚如果我明确提供凭据,为什么这样做很好,如果我只携带登录用户,为什么不这样做
clientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;