WSFederationHttpSecurity.Mode Property

Gets or sets the type of security to be applied.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public WSFederationHttpSecurityMode Mode { get; set; }

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.

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;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft