Пример #1
0
            public void ValidatesSubjectConfirmation()
            {
                // Arrange
                var validator = new DKSaml20SubjectConfirmationValidator();

                var saml20Assertion     = AssertionUtil.GetBasicAssertion();
                var subjectConfirmation = (SubjectConfirmation)Array.Find(saml20Assertion.Subject.Items, item => item is SubjectConfirmation);

                // Act
                validator.ValidateSubjectConfirmation(subjectConfirmation);
            }
Пример #2
0
            public void ThrowsWhenNotOnOrAfterElementIsNotPresent()
            {
                // Arrange
                var validator = new DKSaml20SubjectConfirmationValidator();

                var saml20Assertion     = AssertionUtil.GetBasicAssertion();
                var subjectConfirmation = (SubjectConfirmation)Array.Find(saml20Assertion.Subject.Items, item => item is SubjectConfirmation);

                subjectConfirmation.SubjectConfirmationData.NotOnOrAfter = null;

                // Act
                validator.ValidateSubjectConfirmation(subjectConfirmation);
            }
Пример #3
0
            public void ThrowsWhenNotBeforeElementIsPresent()
            {
                // Arrange
                var validator = new DKSaml20SubjectConfirmationValidator();

                var saml20Assertion     = AssertionUtil.GetBasicAssertion();
                var subjectConfirmation = (SubjectConfirmation)Array.Find(saml20Assertion.Subject.Items, item => item is SubjectConfirmation);

                subjectConfirmation.SubjectConfirmationData.NotOnOrAfter = DateTime.UtcNow;
                subjectConfirmation.SubjectConfirmationData.NotBefore    = DateTime.UtcNow.Subtract(new TimeSpan(5, 0, 0, 0));

                // Act
                validator.ValidateSubjectConfirmation(subjectConfirmation);
            }