Redigeeri

Jagamisviis:


WSFederationHttpSecurity.Mode Property

Definition

Gets or sets the type of security to be applied.

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

Property Value

A WSFederationHttpSecurityMode. The default is Message.

Examples

The following code shows how to set this property.

// 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

Remarks

The enumeration member returned specifies which general type of security is to be applied.

The allowed values are Message and TransportWithMessageCredential.

In the Message security mode, the message is sent over HTTP and SOAP message security is used to protect the message. Client authentication is performed based on the issued token obtained from the security token service. Server authentication is based on the server's certificate.

In the TransportWithMessageCredential security mode, the message is sent over HTTPS. Client authentication is performed by including the issued token obtained from the security token service in the SOAP message. Server authentication, based on the server's certificate, is performed as part of the HTTPS connection setup.

Applies to