SamlSubject.ReadXml Method (XmlDictionaryReader, SamlSerializer, SecurityTokenSerializer, SecurityTokenResolver)


Reads the <saml:Subject> element from the specified XML reader.

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

public virtual void ReadXml(
	XmlDictionaryReader reader,
	SamlSerializer samlSerializer,
	SecurityTokenSerializer keyInfoSerializer,
	SecurityTokenResolver outOfBandTokenResolver


Type: System.Xml.XmlDictionaryReader

A XmlDictionaryReader to read the <saml:Subject> element.

Type: System.IdentityModel.Tokens.SamlSerializer

A SamlSerializer that is capable of reading XML elements in a SAML assertion.

Type: System.IdentityModel.Selectors.SecurityTokenSerializer

A SecurityTokenSerializer that reads the KeyInfo clause of the digital signature.

Type: System.IdentityModel.Selectors.SecurityTokenResolver

A SecurityTokenResolver that determines the security token that created the digital signature.

Exception Condition

reader is null.


samlSerializer is null.


reader refers to an XML element in which one of the following is true:

Contains an <saml:NameIdentifier> element without a value.


Contains an <saml:ConfirmationMehtod> element without a value.


Contains a <saml:SubjectConfirmation> element that does not have at least one <saml:ConfirmationMethod> child element.


Does not contain at least one <saml:ConfirmationMethod> or <saml:NameIdentifier> element.


reader refers to an XML element that contains a <ds:KeyInfo> element that does not have a key that can be retrieved.

The ReadXml(XmlDictionaryReader, SamlSerializer, SecurityTokenSerializer, SecurityTokenResolver) method sets the Name, NameFormat, NameQualifier, ConfirmationMethods, Crypto, KeyIdentifier, and SubjectConfirmationData properties.

.NET Framework
Available since 3.0
Return to top