This documentation is archived and is not being maintained.

ChannelFactory.Credentials Property

Gets the credentials used by clients to communicate a service endpoint over the channels produced by the factory.

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

public ClientCredentials Credentials { get; }
/** @property */
public ClientCredentials get_Credentials ()

public function get Credentials () : ClientCredentials

Not applicable.

Property Value

The ClientCredentials used by clients if they have been configured for the factory or if the endpoint is non-null and is in either the created or opening communication state; otherwise a null reference (Nothing in Visual Basic).

The ClientCredentials object is stored as a type of endpoint behavior and can be accessed through the Behaviors property.

The OnOpened method initializes a read-only copy of the ClientCredentials object for the factory.

The ClientCredentials object is used by the ClientBase class (or a class that derives from this class) to create the proxy objects that can call services. The ClientCredentials object is also accessible through the ClientCredentials property.

NoteNote:

Setting ChannelFactory.Credentials.Windows.AllowedImpersonationLevel to TokenImpersonationLevel.Anonymous always results in an anonymous logon regardless of impersonation level.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: