Closed ethan-agencyQ closed 2 years ago
Yes, this is a bug. The WebSSO Profile states that the NotOnOrAfter in the SubjectConfirmationData is mandatory, but not in the Conditions. So the library should look at that instead.
Won't fix in v2
. Hope I'll get it right in develop/v3
We found out that when the SAML response doesn't have the, the library would throw a NullReferenceException at Sustainsys.Saml2.Saml2P.Saml2PSecurityTokenHandler.ValidateToken (See detail stack trace below).
However, this node should be optional meaning the
samlToken.Assertion.Conditions
can be null, the latest Microsoft.IdentityModel.Tokens.Saml2 library has fixed its bug. So I tried the latest Microsoft library, but Sustainsys would throw another NullReferenceException at Saml2PSecurityTokenHandler (See below) trying to accesssamlToken.Assertion.Conditions.NotOnOrAfter
https://github.com/Sustainsys/Saml2/blob/c466d3bbf12479944e350b649f5b5c825616007b/Sustainsys.Saml2/SAML2P/Saml2PSecurityTokenHandler.cs#L88