Skip to main content
StreamWebSocketControl.ServerCredential | serverCredential property

The credential to use to authenticate to the WebSocket server through HTTP header authentication using a StreamWebSocket object.

Syntax


var serverCredential = streamWebSocketControl.serverCredential;
streamWebSocketControl.serverCredential = serverCredential;

public PasswordCredential ServerCredential { get; set; }

Public Property ServerCredential As PasswordCredential

public:
property PasswordCredential^ ServerCredential { 
   PasswordCredential^ get();
   void set (PasswordCredential^ value);
}

Property value

Type: PasswordCredential

The credential to use to authenticate to the WebSocket server through HTTP header authentication.

Remarks

The ServerCredential property must be set before calling the ConnectAsync method on the StreamWebSocket object. An attempt to set the ServerCredential property after calling the ConnectAsync method will result in an error.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

See also

Other
How to use advanced WebSocket controls (HTML)
How to use advanced WebSocket controls (XAML)
Reference
PasswordCredential
StreamWebSocket
StreamWebSocketControl