Share via


UsernameToken.Label Property

Gets or sets the label parameter for the key derivation algorithm.

Namespace: Microsoft.Web.Services2.Security.Tokens
Assembly: Microsoft.Web.Services2 (in microsoft.web.services2.dll)

Usage

'Usage
Dim usernameToken1 As UsernameToken

Dim returnValue As String
returnValue = usernameToken1.Label

Dim sampleValue As String
usernameToken1.Label = sampleValue

Syntax

'Declaration
Public Property Label() As String
public string Label {get; set;}
public: property String^ Label{
    String^ get();
    Void set(String^);
}
public System.String get_Label();
public void set_Label(System.String);
public function get Label() : String;
public function set Label(String);

Property Value

The label parameter for the key derivation algorithm. The default is the value of the Microsoft.Web.Services2.Security.Tokens.UsernameTokenManager.Label property.

Exceptions

Exception type Condition
System.ArgumentNullException

Label is set to null.

-or-

Label is set to an empty string("").

Remarks

Unlike an X509SecurityToken, a UsernameToken does not have a key associated with. Consequently, the key for a UsernameToken is generated using various properties of the token, including the Label and Nonce properties.

The default value for the Label property of UsernameToken security tokens within an application can be specified by setting the value of the <label> element in the application's configuration file. For more details, see <label> Element .

Both the sender and the receiver of a SOAP message must agree on the same label. Therefore, if you change the Label property of the UsernameToken, you must also change the Label property of the UsernameTokenManager receiving the SOAP message. This can also be accomplished by adding a <label> element with the same value to the configuration files for both the sender and receiver of the SOAP message.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, and Windows 2000

Target Platforms

Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server, Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Longhorn, Pocket PC, Windows CE, Smart Phone

See Also

Reference

UsernameToken Class
Microsoft.Web.Services2.Security.Tokens Namespace

Other Resources

UsernameToken Members