Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

How to write saml token to XML without SubjectConfirmationData

$
0
0

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.



Viewing all articles
Browse latest Browse all 25064

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>