This topic has not yet been rated - Rate this topic

CardSpaceSelector.GetToken Method (XmlElement, IEnumerable<XmlElement>, XmlElement, SecurityTokenSerializer)

Generates a security token using the CardSpace system and the specified endpoint, policy, token issuer, and token serializer.

Namespace:  System.IdentityModel.Selectors
Assembly:  System.IdentityModel.Selectors (in System.IdentityModel.Selectors.dll)
public static GenericXmlSecurityToken GetToken(
	XmlElement endpoint,
	IEnumerable<XmlElement> policy,
	XmlElement requiredRemoteTokenIssuer,
	SecurityTokenSerializer tokenSerializer


Type: System.Xml.XmlElement

An XmlElement that represents the endpoint address of the recipient where the token is presented.

Type: System.Collections.Generic.IEnumerable<XmlElement>

An IEnumerable<T> of type XmlElement that contains a policy fragment that specifies the token types and claims that are requested by the recipient.

Type: System.Xml.XmlElement

An XmlElement that represents the issuer of the token.

Type: System.IdentityModel.Selectors.SecurityTokenSerializer

A SecurityTokenSerializer that can read a KeyInfo clause.

Return Value

Type: System.IdentityModel.Tokens.GenericXmlSecurityToken
A GenericXmlSecurityToken that represents the generated security token.

endpoint is null.


policy is null.


tokenSerializer is null.

A security token can be issued by the user or by a third party that is specified by the policy issuer.

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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.