WSFederationHttpSecurity.Mode 属性

定义

获取或设置要应用的安全类型。

public:
 property System::ServiceModel::WSFederationHttpSecurityMode Mode { System::ServiceModel::WSFederationHttpSecurityMode get(); void set(System::ServiceModel::WSFederationHttpSecurityMode value); };
public System.ServiceModel.WSFederationHttpSecurityMode Mode { get; set; }
member this.Mode : System.ServiceModel.WSFederationHttpSecurityMode with get, set
Public Property Mode As WSFederationHttpSecurityMode

属性值

WSFederationHttpSecurityMode。 默认值为 Message

示例

下面的代码演示如何设置此属性。

// This method creates a WSFederationHttpBinding.
public static WSFederationHttpBinding
    CreateWSFederationHttpBinding(bool isClient)
{
  // Create an instance of the WSFederationHttpBinding.
  WSFederationHttpBinding b = new WSFederationHttpBinding();

  // Set the security mode to Message.
  b.Security.Mode = WSFederationHttpSecurityMode.Message;
' This method creates a WSFederationHttpBinding.
Public Shared Function CreateWSFederationHttpBinding(ByVal isClient As Boolean) As WSFederationHttpBinding
  ' Create an instance of the WSFederationHttpBinding.
  Dim b As New WSFederationHttpBinding()

  ' Set the security mode to Message.
  b.Security.Mode = WSFederationHttpSecurityMode.Message

注解

返回的枚举成员指定要应用的常规安全类型。

允许值为 MessageTransportWithMessageCredential

Message 安全模式中,通过 HTTP 发送消息,并且使用 SOAP 消息安全保护消息。 基于从安全令牌服务获取的已颁发令牌执行客户端身份验证。 服务器身份验证基于服务器证书。

TransportWithMessageCredential 安全模式中,消息通过 HTTPS 发送。 通过将从安全令牌服务获取的已颁发令牌包含在 SOAP 消息中执行客户端身份验证。 基于服务器证书的服务器身份验证作为 HTTPS 连接安装的一部分执行。

适用于