SecurityBindingElement 和 userNameAuthentication
我不明白为什么在 WCF 中,如果我们在 serviceBehaviors 中有 userNameAuthentication(如果模式是证书,则在 ClientCredentials),我们需要在绑定中使用 SecurityBindingElement 来进行身份验证?或者它只是身份验证实现的新扩展和替代方式。
I can't understand why in WCF we need a SecurityBindingElement in binding for authentication purposes if we have userNameAuthentication in serviceBehaviors (or ClientCredentials if mode is certificate)? Or it's just a new extension and alternate way of authentication implementation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这不是什么新鲜事。
绑定元素是绑定的一部分 - 它指定与服务通信所需的协议栈/策略。如果您在绑定中设置带有用户名身份验证的安全绑定,则表示您的服务需要 WS-Security UserName 令牌配置文件进行身份验证 = 它说明了必须在消息中传输的内容。
行为说明如何配置身份验证。您收到一条消息,现在您必须以某种方式验证服务上的凭据。行为指定验证这些凭据的方式。在客户端行为指定将哪些凭据传递给服务。
No it is not anything new.
Binding element is part of binding - it specify protocol stack / policies needed to communicate with the service. If you set security binding with user name authentication in the binding you are saying that your service demands WS-Security UserName token profile for authentication = it says what must be transferred in the message.
Behavior says how the authentication is configured. You got a message and now you must somehow validate credentials on the service. Behavior specifies the way how these credentials will be validated. On client side behavior specifies what credentials will be passed to the service.