Search code examples
saml-2.0itfoxtec-identity-saml2

How to add new parameters/organization specific parameters into XML


I am using this excellent library. All is working fine with temp IDP server from OKTA. I wanted to understand about XML request which is being sent to IDP server. In this code, where this xml file is getting built or how to add new parameters into it. I am not trying understand this but not getting it as during debug i get xmldoc as null.

Many thanks !!


Solution

  • The XML is generated on the fly by the component. It is possible to se the XML right before the message is send after the Bind method has been called.

    E.g., like this on a Saml2AuthnRequest:

    var saml2AuthnRequest = new Saml2AuthnRequest(config);
    binding.Bind(saml2AuthnRequest);
    var xml = saml2AuthnRequest.XmlDocument.OuterXml;
    

    Maybe it is possible to change the XML afterword’s, if it is not signed. But I have not tried it.