SamlSerializer.WriteToken Method (SamlSecurityToken, XmlWriter, SecurityTokenSerializer)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Writes the specified SAML security token into the specified XML serializer.

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

public virtual void WriteToken(
	SamlSecurityToken token,
	XmlWriter writer,
	SecurityTokenSerializer keyInfoSerializer
)

Parameters

token
Type: System.IdentityModel.Tokens.SamlSecurityToken

The SamlSecurityToken to write.

writer
Type: System.Xml.XmlWriter

An XmlDictionaryWriter to write the SAML authorization statement.

keyInfoSerializer
Type: System.IdentityModel.Selectors.SecurityTokenSerializer

A SecurityTokenSerializer that is capable of writing KeyInfo clauses.

Exception Condition
ArgumentNullException

writer is null

-or-

token is null

Use the WriteToken(SamlSecurityToken, XmlWriter, SecurityTokenSerializer) method to serialize a SamlSecurityToken security token. To deserialize a SamlSecurityToken use the ReadToken(XmlReader, SecurityTokenSerializer, SecurityTokenResolver) method.

.NET Framework
Available since 3.0
Return to top
Show: