Share via


SoapContext.IdentityToken Property

Gets or sets the identity security token for a SOAP message.

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

Usage

'Usage
Dim soapContext1 As SoapContext

Dim returnValue As SecurityToken
returnValue = soapContext1.IdentityToken

Dim sampleValue As SecurityToken
soapContext1.IdentityToken = sampleValue

Syntax

'Declaration
Public Property IdentityToken() As SecurityToken
public SecurityToken IdentityToken {get; set;}
public: property SecurityToken^ IdentityToken{
    SecurityToken^ get();
    Void set(SecurityToken^);
}
public SecurityToken get_IdentityToken();
public void set_IdentityToken(SecurityToken);
public function get IdentityToken() : SecurityToken;
public function set IdentityToken(SecurityToken);

Property Value

The SecurityToken that represents the identity token for the SOAP message.

Exceptions

Exception type Condition
System.ArgumentException

The IdentityToken property has already been set and the property is being set to a security token that is not equivalent to the current value. The Microsoft.Web.Services2.Security.Tokens.SecurityToken.Equalsmethod is called to determine whether the two security tokens are valid.

Remarks

The identity token for a SOAP message specifies the sender's identity for a SOAP message. Which security token in the SOAP message is the identity token is determined by application code, policy or a custom input filter that receives the SOAP request. There is no XML in the SOAP message that specifies which security token is the identity token. Once it is determined which security token is the identity token, it is up to the application how the identity token is used, with the exception of policy.

When the IdentityToken property is set by policy, it is usally done when policy is used to encrypt SOAP responses using the security token that signed a portion of a SOAP request and there may be more than one security token that signed the SOAP message. To disambiguate which security token must be used to encrypt the SOAP response, add the wse:IdentityToken attribute to the <SecurityToken> element to both the <Integrity> and <Confidentiality> elements of a policy file. Adding the wse:IdentityToken attribute to a <SecurityToken> element within an <Integrity> assertion for incoming request policy, specifies that a security token that matches the integrity assertion is the identity token. When a SOAP request is received with a security token that matches the security token specified in the integrity assertion, policy sets the IdentityToken property to the matched security token. Likewise, adding the wse:IdentityToken attribute to a <SecurityToken> element within a <Confidentiality> element for outgoing response policy, specifies to policy that SOAP responses must be encrypted using the security token set to the value of the IdentityToken property of the SoapContext that is associated with the SOAP request.

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

SoapContext Class
Microsoft.Web.Services2 Namespace

Other Resources

SoapContext Members
ms824658(v=msdn.10).md
ms825899(v=msdn.10).md
ms824629(v=msdn.10).md