gpt4 book ai didi

c# - 在主机 ('Anonymous' 上配置的身份验证方案不允许在绑定(bind) 'WebHttpBinding' 上配置的那些 ('Basic' )

转载 作者:太空狗 更新时间:2023-10-29 22:16:05 30 4
gpt4 key购买 nike

我正在按照这里的教程进行操作:http://allen-conway-dotnet.blogspot.co.uk/2012/07/using-basic-authentication-in-rest.html?_sm_au_=iFVksVM0H8QrkntP , 在 WCF 服务中实现用户身份验证,但出现以下错误:

The authentication schemes configured on the host ('Anonymous') do not allow those configured on the binding 'WebHttpBinding' ('Basic'). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly. Additionally, this may be resolved by changing the authentication schemes for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property, in the application configuration file at the element, by updating the ClientCredentialType property on the binding, or by adjusting the AuthenticationScheme property on the HttpTransportBindingElement.

我确实尝试在项目中禁用“匿名身份验证”,但我得到的只是错误 401 - 未经授权。没有出现输入用户名和密码的提示。有谁知道为什么会出现此问题以及如何解决?

最佳答案

我终于设法通过添加来解决这个问题:

<behavior name="...">
...
<serviceAuthenticationManager authenticationSchemes="Basic"/>
...
</behavior>

关于c# - 在主机 ('Anonymous' 上配置的身份验证方案不允许在绑定(bind) 'WebHttpBinding' 上配置的那些 ('Basic' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25626217/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com