This documentation is archived and is not being maintained.

GenericXmlSecurityToken Constructor

Initializes a new instance of the GenericXmlSecurityToken class.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

public GenericXmlSecurityToken(
	XmlElement tokenXml,
	SecurityToken proofToken,
	DateTime effectiveTime,
	DateTime expirationTime,
	SecurityKeyIdentifierClause internalTokenReference,
	SecurityKeyIdentifierClause externalTokenReference,
	ReadOnlyCollection<IAuthorizationPolicy> authorizationPolicies
)

Parameters

tokenXml
Type: System.Xml.XmlElement

An XmlElement that represents the XML that is associated with the security token. Sets the TokenXml property.

proofToken
Type: System.IdentityModel.Tokens.SecurityToken

A SecurityToken that represents the proof token for the security token. Sets the ProofToken property.

effectiveTime
Type: System.DateTime

A DateTime that represents the first instant in time at which this security token is valid. Sets the ValidFrom property.

expirationTime
Type: System.DateTime

A DateTime that represents the last instant in time at which this security token is valid. Sets the ValidFrom property.

internalTokenReference
Type: System.IdentityModel.Tokens.SecurityKeyIdentifierClause

A SecurityKeyIdentifierClause that represents a reference to this security token when it is included in a SOAP message in which it is referenced. Sets the InternalTokenReference property.

externalTokenReference
Type: System.IdentityModel.Tokens.SecurityKeyIdentifierClause

A SecurityKeyIdentifierClause that represents a reference to this security token when it is not included in a SOAP message in which it is referenced. Sets the ValidFrom property.

authorizationPolicies
Type: System.Collections.ObjectModel.ReadOnlyCollection<IAuthorizationPolicy>

A ReadOnlyCollection<T> of type IAuthorizationPolicy that contains the set authorization policies for this security token.

ExceptionCondition
ArgumentNullException

tokenXml is null.

-or-

proofToken is null.

When the internalTokenReference parameter is null, a LocalIdKeyIdentifierClause key identifier clause is created for this security token and set to the InternalTokenReference property.

When the GenericXmlSecurityToken is obtained in a federation scenario, the proof token contains the key that is encrypted for the client. For more information about federation, see Federation and Issued Tokens.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0
Show: