gpt4 book ai didi

.net - 断开连接的域客户端上的 SecurityNegotiationException

转载 作者:行者123 更新时间:2023-12-01 11:08:55 25 4
gpt4 key购买 nike

当我在我的开发机器上运行 WCF 服务时,只要客户端连接到域,它就可以工作。

当机器断开连接时,出现以下异常:

System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you

该服务在内部使用安全性 (<transport clientCredentialType="Windows" protectionLevel="None"/>),因此我无法轻易将其关闭。

有没有办法解决这个问题,以便我可以在未连接时测试服务?

最佳答案

未连接到域时可能无法工作。

多个绑定(bind)的默认 WCF 安全性是“Windows”,例如您当前的用户凭据将传递给 WCF 服务,然后该服务会尝试针对 Windows 域验证这些用户凭据。

如果您未连接,则无法进行验证,因此 WCF 服务将拒绝调用。按设计工作,我会说:-)

也许您可以为不需要 Windows 身份验证的服务公开第二个端点(“本地开发测试”)?离开域时,只需连接到该非安全端点,这样您至少可以测试服务及其内部工作。

关于.net - 断开连接的域客户端上的 SecurityNegotiationException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2377589/

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