简体   繁体   English

以下配置在WCF的上下文中意味着什么?

[英]What does the following configuration mean in the context of WCF?

I added a WCF as a service reference to my client app from VS2013 and it generated the following config section in the app.config file. 我从VS2013添加了一个WCF作为我的客户端应用程序的服务引用,它在app.config文件中生成了以下配置部分。

                <security mode="Message">
                    <transport clientCredentialType="None" />
                    <message clientCredentialType="None" />
                </security>

What does this mean? 这是什么意思? The security mode is message but there are separate entities inside that for transport and message. 安全模式是消息,但内部有单独的实体用于传输和消息。 I am confused. 我很困惑。

You have two primary choices for providing transfer security: either you provide the transfer security on the transport level, or on the message level. 提供传输安全性有两个主要选择:要么在传输级别提供传输安全性,要么在消息级别提供传输安全性。

There is a nice article on MSDN discussing this here . MSDN上有一篇很好的文章在这里讨论。

Transport Security: 运输安全:

When using transport security, the user credentials and claims are passed by using the transport layer. 使用传输安全性时,将使用传输层传递用户凭据和声明。 In other words, user credentials are transport-dependent, which allows fewer authentication options compared to message security. 换句话说,用户凭据是依赖于传输的,与消息安全性相比,它允许更少的身份验证选项。

Message Security: 消息安全:

When using message security, the user credentials and claims are encapsulated in every message using the WS-Security specification to secure messages. 使用消息安全性时,使用WS-Security规范将用户凭据和声明封装在每封消息中以保护消息。 This option gives the most flexibility from an authentication perspective. 此选项从身份验证角度提供最大的灵活性。 You can use any type of security credentials you want, largely independent of transport, as long as both the client and service agree. 只要客户端和服务都同意,您就可以使用任何类型的安全凭证,这些凭证在很大程度上独立于传输。

Update per comment 每条评论更新

What it means in the context of the configuration file that you provided: 在您提供的配置文件的上下文中它意味着什么:

After setting a security mode (in this case message ), you have the option of setting the client credential type. 设置security mode (在本例中为message )后,您可以选择设置客户端凭据类型。 The client credential type property specifies what type of credential the client must provide to the service for authentication. 客户端凭据类型属性指定客户端必须为服务提供哪种类型的凭据以进行身份​​验证。 In this case, if either transport or message are specified as the security mode then they will use None as the client credential type which means that the client does not have to present any credential. 在这种情况下,如果将transportmessage指定为security mode则它们将使用None作为客户端凭据类型,这意味着客户端不必提供任何凭据。

Currently, the following line is essentially being ignored as message is the specified security mode . 目前,以下行基本上被忽略,因为message是指定的security mode

<transport clientCredentialType="None" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM