IIS Developer Express 上的 WCF 4 Rest 服务,身份验证问题
当我在 IIS Developer Express 中托管“WCF 4 Rest Service Template”项目(来自模板)时,我得到以下信息:
IIS指定了身份验证方案“IntegratedWindowsAuthentication,Anonymous”,但绑定仅支持恰好一种认证方案的规范。有效的身份验证方案包括摘要式、协商式、NTLM、基本式或匿名式。更改 IIS 设置,以便仅使用单一身份验证方案。
除了将 automaticFormatSelectionEnabled 设置为 false 以便返回 JSON 之外,我没有显式更改任何配置
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<!--Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below-->
<standardEndpoint name=""
helpEnabled="true"
automaticFormatSelectionEnabled="false"
/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
:显式设置是问题,那么对于这种服务,我该如何执行此操作,以便显式设置服务的身份验证方案以避免 iis Developer Express 出现此问题?
注意:我有以下程序集 Microsoft.Web.dll 和应用程序的 Web 服务项目 /bin 文件夹中的 Microsoft.Web.Administration.dll,如 iss 团队博客上的跳转 WCF 服务的解决方法中所述: http://blogs. iis.net/vaidyg/archive/2010/07/21/wcf-workaround-for-webmatrix-beta.aspx
When I host the "WCF 4 Rest Service Template" project (from template) in IIS Developer Express I get the following:
IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.
I have not changed any configuration explicitly other than setting automaticFormatSelectionEnabled to false in order to return JSON:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<standardEndpoints>
<webHttpEndpoint>
<!--Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below-->
<standardEndpoint name=""
helpEnabled="true"
automaticFormatSelectionEnabled="false"
/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
If the endpoint configuration not being set explicitly is the issue then how would I do so for this kind of service, in order to set the authentication scheme for the service explicitly to avoid this issue with iis developer express?
Note: I have the following assemblies Microsoft.Web.dll & Microsoft.Web.Administration.dll in the web service projects /bin folder of the application as described in workaround for hopsting WCF services here on the iss team blog:
http://blogs.iis.net/vaidyg/archive/2010/07/21/wcf-workaround-for-webmatrix-beta.aspx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将需要禁用不需要的身份验证方案,我猜是 Windows 身份验证。因此:
true 到 false
这将禁用所有站点的 Windows 身份验证,您也可以在文件底部最后一个 之前添加一个位置路径。特定站点(在本例中为 YourSite)的行添加:
这只会为特定站点禁用该行。
You will need to disable the authentication scheme that is not needed, my guess Windows authnetication. So:
true to false
That will disable Windows Authentication for all sites, you could alternatively add a location path at the bottom of the file right before the last </configuration> line for the specific site (YourSite in this case) add:
This will only disable that for the specific site.