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
)

Parameters

writer
Type: System.Xml.XmlWriter

The XmlWriter to use for the serialization.

data
Type: System.IdentityModel.Tokens.Saml2Assertion

A Saml2Assertion that represents the assertion to serialize.

ExceptionCondition
ArgumentNullException

writer is null.

-or-

data is null.

InvalidOperationException

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

-or-

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.

-or-

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).

CryptographicException

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

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft