Export (0) Print
Expand All
Expand Minimize

Saml2SecurityTokenHandler.WriteAssertion Method

.NET Framework 4.5

Serializes the specified SAML assertion to the specified XML writer.

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

protected virtual void WriteAssertion(
	XmlWriter writer,
	Saml2Assertion data


Type: System.Xml.XmlWriter

The XmlWriter to use for the serialization.

Type: System.IdentityModel.Tokens.Saml2Assertion

A Saml2Assertion that represents the assertion to serialize.


writer is null.


data is null.


The assertion specified by data has both the EncryptingCredentials and ReceivedEncryptingCredentials properties set to null.


There are no statements and no subject in the assertion specified by data. (Both the Subject property and the Statements property are null.) If an assertion does not contain statements, it must contain a subject.


The assertion specified by data contains an authentication, attribute, or authorization decision statement and no subject—these statements require a subject. (The Statements property contains a statement of type Saml2AttributeStatement, Saml2AuthenticationStatement, or Saml2AuthorizationDecisionStatement and the Subject property is null).


The token encrypting credentials do not have a Symmetric Key specified.

.NET Framework

Supported in: 4.6, 4.5
© 2015 Microsoft