Forums, Documentation & Knowledge Base - ComponentSpace

Using old version with recent installation of .net framework 4.7.2


https://componentspace.com/forums/Topic11726.aspx

By ndenny - 8/31/2021

We are using version 2.5.0.8 with a sha2 cert to sign saml 2.0 messages.
This has worked for years across different windows and .net framework versions, up to and INCLUDING 4.6.1.

We use the low level saml implementation on a DotNetNuke site, which requires us to install .net framework 4.7.2.
Since doing this in our dev environment, we now get an error using the same cert and code we were using before.
Note that we didn't change the code at all - it is still compiled for .net framework 4.5.2, which has worked for more than a year on the previous version (.net framework 4.6.1).

SAMLAssertionSignature.Generate(xmlSamlAssertion, cert.PrivateKey, cert);

Error Message (this doesn't really tell me anything)
Message:Failed to generate XML signature.

StackTrace:
InnerMessage:Failed to generate XML signature.
InnerStackTrace:
 at ComponentSpace.SAML2.Utility.XmlSignature.Generate(XmlElement xmlElement, String elementId, AsymmetricAlgorithm signingKey, KeyInfo keyInfo, SignedXml signedXml, String inclusiveNamespacesPrefixList, String digestMethod, String signatureMethod)
 at ComponentSpace.SAML2.Utility.XmlSignature.Generate(XmlElement xmlElement, String elementId, AsymmetricAlgorithm signingKey, X509Certificate2Collection x509Certificates, SignedXml signedXml, String inclusiveNamespacesPrefixList, String digestMethod, String signatureMethod)
 at ComponentSpace.SAML2.Utility.XmlSignature.Generate(XmlElement xmlElement, String elementId, AsymmetricAlgorithm signingKey, X509Certificate2 x509Certificate, SignedXml signedXml, String inclusiveNamespacesPrefixList, String digestMethod, String signatureMethod)
 at ComponentSpace.SAML2.Assertions.SAMLAssertionSignature.Generate(XmlElement xmlElement, AsymmetricAlgorithm signingKey, X509Certificate2 x509Certificate, String inclusiveNamespacesPrefixList, String digestMethod, String signatureMethod)
 at ComponentSpace.SAML2.Assertions.SAMLAssertionSignature.Generate(XmlElement xmlElement, AsymmetricAlgorithm signingKey, X509Certificate2 x509Certificate)
 at SAMLPost()
By ComponentSpace - 9/27/2021

Was anything written to the log file?

The type initializer calls Diagnostics.Verbose to log the product version number and some environment information.