How to use AuthnRequest with Extensions

Hello,

Our Idp requires us to use saml2p:Extensions. I understand that Extensions is not supported for the “high level apis”.
But how should I use the “low level apis” in asp.net core?

I made two attempts, but both end up with an exception.


var authnRequest = new AuthnRequest();
var doc = new XmlDocument();
doc.LoadXml(“123”);
authnRequest.Extensions = new Extensions(doc.DocumentElement);


throws: SamlSerializationException: The XML is not an Extensions.



var authnRequest = new AuthnRequest();
var doc = new XmlDocument();
doc.LoadXml(“123”);
var extensions = new Extensions();
extensions.Data = new List(1)
{
doc.DocumentElement
};
authnRequest.Extensions = extensions;
// Now it is okay till here. Next line will throw;
authnRequest.ToXml();


ArgumentException: The node to be inserted is from a different document context.

Is there a full example how to use authnRequest with asp.net core? If the object was constructed succesfully, should I then send it manually using a http client?

Thieme

Our apologies but this is a bug in the Extensions class. The fix will be included in the v2.0.2 release.
It would be better to not use the low level APIs.
We will probably extend the high level API to support this requirement.
Please email us at support@componentspace.com so we can discuss your requirements and send a beta to you.