Export (0) Print
Expand All

Authorization.ConnectionGroupId Property

Gets a unique identifier for user-specific connections.

Namespace: System.Net
Assembly: System (in system.dll)

'Declaration
Public ReadOnly Property ConnectionGroupId As String
'Usage
Dim instance As Authorization
Dim value As String

value = instance.ConnectionGroupId

/** @property */
public String get_ConnectionGroupId ()

public function get ConnectionGroupId () : String

Property Value

A unique string that associates a connection with an authenticating entity.

The ConnectionGroupId property is a unique string that associates a connection with a specific authenticating entity. For example, the NTLM authorization module ties the authentication credential information to a specific connection to prevent invalid reuse of the connection.

The following code example uses the ConnectionGroupId property to get the group identifier returned by the server. For a complete example, refer to the AuthenticationManager class.


' Create the encrypted string according to the Basic authentication format as
' follows:
' a)Concatenate the username and password separated by colon;
' b)Apply ASCII encoding to obtain a stream of bytes;
' c)Apply Base64 encoding to this array of bytes to obtain the encoded 
' authorization.
Dim BasicEncrypt As String = MyCreds.UserName + ":" + MyCreds.Password

Dim BasicToken As String = "Basic " + Convert.ToBase64String(ASCII.GetBytes(BasicEncrypt))

' Create an Authorization object using the encoded authorization above.
Dim resourceAuthorization As New Authorization(BasicToken)

' Get the Message property, which contains the authorization string that the 
' client returns to the server when accessing protected resources.
Console.WriteLine(ControlChars.Lf + " Authorization Message:{0}", resourceAuthorization.Message)

' Get the Complete property, which is set to true when the authentication process 
' between the client and the server is finished.
Console.WriteLine(ControlChars.Lf + " Authorization Complete:{0}", resourceAuthorization.Complete)

Console.WriteLine(ControlChars.Lf + " Authorization ConnectionGroupId:{0}", resourceAuthorization.ConnectionGroupId)


// Create the encrypted string according to the Basic authentication 
// format as follows:
// a)Concatenate the username and password separated by colon;
// b)Apply ascii encoding to obtain a stream of bytes;
// c)Apply Base64 encoding to this array of bytes to obtain the encoded 
// authorization.
String basicEncrypt = myCreds.get_UserName() + ":" 
    + myCreds.get_Password();
String basicToken = "Basic " 
    + Convert.ToBase64String(ascii.GetBytes(basicEncrypt));

// Create an Authorization object using the encoded
// authorization above.
Authorization resourceAuthorization = new Authorization(basicToken);

// Get the Message property, which contains the authorization string 
// that the client returns to the server when accessing protected 
// resources.
Console.WriteLine("\n Authorization Message:{0}", 
    resourceAuthorization.get_Message());

// Get the Complete property, which is set to true when the 
// authentication process between the client and the
// server is finished.
Console.WriteLine("\n Authorization Complete:{0}", 
    System.Convert.ToString(resourceAuthorization.get_Complete()));


Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft