CreateSecurityTokenSerializer Method
Collapse the table of content
Expand the table of content

SecurityTokenManager.CreateSecurityTokenSerializer Method

Gets an XML serializer that can serialize security tokens in the specified version of the WS-* specifications.

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

public abstract SecurityTokenSerializer CreateSecurityTokenSerializer(
	SecurityTokenVersion version
)

Parameters

version
Type: System.IdentityModel.Selectors.SecurityTokenVersion
A SecurityTokenVersion that specifies the WS-* specification versions that security tokens adhere to.

Return Value

Type: System.IdentityModel.Selectors.SecurityTokenSerializer
A SecurityTokenSerializer to serialize the security tokens.

To add serialization support for a custom token, derive a class from WSSecurityTokenSerializer and return an instance of that class for the CreateSecurityTokenSerializer(SecurityTokenVersion) method. The WSSecurityTokenSerializer class, which derives from the SecurityTokenSerializer class, is capable of serializing and deserializing the security tokens that ship with . Thus, to add support for a custom token to the serializer, override the virtual methods in the WSSecurityTokenSerializer class, add code that checks whether the desired security token is the custom token, and, if not, call the base class method.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2016 Microsoft