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
)

Parameters

reader
Type: System.Xml.XmlDictionaryReader

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

samlSerializer
Type: System.IdentityModel.Tokens.SamlSerializer

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

keyInfoSerializer
Type: System.IdentityModel.Selectors.SecurityTokenSerializer

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

outOfBandTokenResolver
Type: System.IdentityModel.Selectors.SecurityTokenResolver

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

Exception Condition
ArgumentNullException

reader is null.

-or-

samlSerializer is null.

SecurityTokenException

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

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

-or-

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

-or-

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

-or-

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

SecurityException

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
Show: