/** * Extract the expiration time from an {@link AssertionType} * @param assertion * @return */ public static XMLGregorianCalendar getExpiration(AssertionType assertion) { XMLGregorianCalendar expiry = null; ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { expiry = conditionsType.getNotOnOrAfter(); } return expiry; }
/** * Extract the expiration time from an {@link AssertionType} * * @param assertion * @return */ public static XMLGregorianCalendar getExpiration(AssertionType assertion) { XMLGregorianCalendar expiry = null; ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { expiry = conditionsType.getNotOnOrAfter(); } return expiry; }
/** * Extract the expiration time from an {@link AssertionType} * * @param assertion * * @return */ public static XMLGregorianCalendar getExpiration(AssertionType assertion) { XMLGregorianCalendar expiry = null; ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { expiry = conditionsType.getNotOnOrAfter(); } return expiry; }
/** * Extract the expiration time from an {@link AssertionType} * * @param assertion * * @return */ public static XMLGregorianCalendar getExpiration(AssertionType assertion) { XMLGregorianCalendar expiry = null; ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { expiry = conditionsType.getNotOnOrAfter(); } return expiry; }
/** * Extract the expiration time from an {@link AssertionType} * @param assertion * @return */ public static XMLGregorianCalendar getExpiration(AssertionType assertion) { XMLGregorianCalendar expiry = null; ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { expiry = conditionsType.getNotOnOrAfter(); } return expiry; }
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); if (!XMLTimeUtil.isValid(now, notBefore, notOnOrAfter)) { String msg = "SAML Assertion has expired: " + "Now=" + now.toXMLFormat() + " ::notBefore="
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); if (!XMLTimeUtil.isValid(now, notBefore, notOnOrAfter)) { String msg = "SAML Assertion has expired: " + "Now=" + now.toXMLFormat() + " ::notBefore="
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); if (!XMLTimeUtil.isValid(now, notBefore, notOnOrAfter)) { String msg = Messages.format("SAMLBearerTokenUtil.AssertionExpired", now.toXMLFormat(), //$NON-NLS-1$
/** * Check whether the assertion has expired * @param assertion * @return * @throws ConfigurationException */ public static boolean hasExpired(AssertionType assertion) throws ConfigurationException { boolean expiry = false; //Check for validity of assertion ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); if (trace) log.trace("Now=" + now.toXMLFormat() + " ::notBefore=" + notBefore.toXMLFormat() + "::notOnOrAfter=" + notOnOrAfter); expiry = !XMLTimeUtil.isValid(now, notBefore, notOnOrAfter); if (expiry) { log.info("Assertion has expired with id=" + assertion.getID()); } } //TODO: if conditions do not exist, assume the assertion to be everlasting? return expiry; }
/** * Check whether the assertion has expired * @param assertion * @return * @throws ConfigurationException */ public static boolean hasExpired(AssertionType assertion) throws ConfigurationException { boolean expiry = false; //Check for validity of assertion ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); if (trace) log.trace("Now=" + now.toXMLFormat() + " ::notBefore=" + notBefore.toXMLFormat() + "::notOnOrAfter=" + notOnOrAfter); expiry = !XMLTimeUtil.isValid(now, notBefore, notOnOrAfter); if (expiry) { log.info("Assertion has expired with id=" + assertion.getID()); } } //TODO: if conditions do not exist, assume the assertion to be everlasting? return expiry; }
XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar updatedNotBefore = XMLTimeUtil.subtract(notBefore, clockSkewInMilis); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); XMLGregorianCalendar updatedOnOrAfter = XMLTimeUtil.add(notOnOrAfter, clockSkewInMilis);
XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar updatedNotBefore = XMLTimeUtil.subtract(notBefore, clockSkewInMilis); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); XMLGregorianCalendar updatedOnOrAfter = XMLTimeUtil.add(notOnOrAfter, clockSkewInMilis);
/** * Check whether the assertion has expired * * @param assertion * @return * @throws ConfigurationException */ public static boolean hasExpired(AssertionType assertion) throws ConfigurationException { boolean expiry = false; // Check for validity of assertion ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); logger.trace("Now=" + now.toXMLFormat() + " ::notBefore=" + notBefore.toXMLFormat() + " ::notOnOrAfter=" + notOnOrAfter); expiry = !XMLTimeUtil.isValid(now, notBefore, notOnOrAfter); if (expiry) { logger.samlAssertionExpired(assertion.getID()); } } // TODO: if conditions do not exist, assume the assertion to be everlasting? return expiry; }
XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar updatedNotBefore = XMLTimeUtil.subtract(notBefore, clockSkewInMilis); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); XMLGregorianCalendar updatedOnOrAfter = XMLTimeUtil.add(notOnOrAfter, clockSkewInMilis);
/** * Verify whether the assertion has expired. You can add in a clock skew to adapt to conditions where in the IDP and SP are * out of sync. * * @param assertion * @param clockSkewInMilis in miliseconds * @return * @throws ConfigurationException */ public static boolean hasExpired(AssertionType assertion, long clockSkewInMilis) throws ConfigurationException { boolean expiry = false; // Check for validity of assertion ConditionsType conditionsType = assertion.getConditions(); if (conditionsType != null) { XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar updatedNotBefore = XMLTimeUtil.subtract(notBefore, clockSkewInMilis); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); XMLGregorianCalendar updatedOnOrAfter = XMLTimeUtil.add(notOnOrAfter, clockSkewInMilis); logger.trace("Now=" + now.toXMLFormat() + " ::notBefore=" + notBefore.toXMLFormat() + " ::notOnOrAfter=" + notOnOrAfter); expiry = !XMLTimeUtil.isValid(now, updatedNotBefore, updatedOnOrAfter); if (expiry) { logger.samlAssertionExpired(assertion.getID()); } } // TODO: if conditions do not exist, assume the assertion to be everlasting? return expiry; }
XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar updatedNotBefore = XMLTimeUtil.subtract(notBefore, clockSkewInMilis); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter(); XMLGregorianCalendar updatedOnOrAfter = XMLTimeUtil.add(notOnOrAfter, clockSkewInMilis);
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter();
XMLGregorianCalendar now = XMLTimeUtil.getIssueInstant(); XMLGregorianCalendar notBefore = conditionsType.getNotBefore(); XMLGregorianCalendar notOnOrAfter = conditionsType.getNotOnOrAfter();
subjectConfirmationData.setNotOnOrAfter(conditions.getNotOnOrAfter());
subjectConfirmationData.setNotOnOrAfter(assertion.getConditions().getNotOnOrAfter());