Handle date equality when checking for saml assertion validity
This commit is contained in:
parent
9d4cafd2c9
commit
9e95ee5825
|
|
@ -133,6 +133,7 @@ public final class AssertionImpl implements Assertion {
|
|||
}
|
||||
|
||||
final Date now = new Date();
|
||||
return this.validFromDate.before(now) && (this.validUntilDate == null || this.validUntilDate.after(now));
|
||||
return (this.validFromDate.before(now) || this.validFromDate.equals(now))
|
||||
&& (this.validUntilDate == null || this.validUntilDate.after(now) || this.validUntilDate.equals(now));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
package org.jasig.cas.client.validation;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import junit.framework.TestCase;
|
||||
|
|
@ -50,7 +51,7 @@ public final class AssertionImplTests extends TestCase {
|
|||
}
|
||||
|
||||
public void testAssertionValidity() throws Exception {
|
||||
final Assertion assertion = new AssertionImpl(CONST_PRINCIPAL, CONST_ATTRIBUTES);
|
||||
final Assertion assertion = new AssertionImpl(CONST_PRINCIPAL, new Date(), new Date(), new Date(), CONST_ATTRIBUTES);
|
||||
assertTrue(assertion.isValid());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue