Hi,
I would like to serialize saml token to XML and I am using that code:
if (handler.CanWriteToken) { var sb = new StringBuilder(); handler.WriteToken(new XmlTextWriter(new StringWriter(sb)), token); return sb.ToString(); }
It works ok but I would like to ignore SubjectConfirmationData node, so I wouldn't like to write attributes like Recipient, InResponseTo etc in this XML representation of token.
Is there any way to do this? I tried to override method in Saml2SecurityTokenHandler:
protected override void WriteSubjectConfirmationData(XmlWriter writer, Saml2SubjectConfirmationData data) { //base.WriteSubjectConfirmationData(writer, data); }
but after that it's still works the same, so this section is added also to XML.
Thanx for any help.