WebSSOProfileConsumerImpl extends AbstractProfileBase implements WebSSOProfileConsumer { protected void verifyAuthenticationStatement(AuthnStatement auth, RequestedAuthnContext requestedAuthnContext, SAMLMessageContext context) throws AuthenticationException { if (!isDateTimeSkewValid(getResponseSkew(), getMaxAuthenticationAge(), auth.getAuthnInstant())) { throw new CredentialsExpiredException("Authentication statement is too old to be used with value " + auth.getAuthnInstant()); } if (auth.getSessionNotOnOrAfter() != null && auth.getSessionNotOnOrAfter().isBeforeNow()) { throw new CredentialsExpiredException("Authentication session is not valid on or after " + auth.getSessionNotOnOrAfter()); } verifyAuthnContext(requestedAuthnContext, auth.getAuthnContext(), context); } WebSSOProfileConsumerImpl();  WebSSOProfileConsumerImpl(SAMLProcessor processor, MetadataManager manager); @Override String getProfileIdentifier(); SAMLCredential processAuthenticationResponse(SAMLMessageContext context); long getMaxAuthenticationAge(); void setMaxAuthenticationAge(long maxAuthenticationAge); boolean isIncludeAllAttributes(); void setIncludeAllAttributes(boolean includeAllAttributes); boolean isReleaseDOM(); void setReleaseDOM(boolean releaseDOM);  }
@Test public void testDefaultAuthNStatementPasses() throws Exception { AuthnStatement statement = helper.getValidAuthStatement(); profile.verifyAuthenticationStatement(statement, null, messageContext); }
@Test(expected = CredentialsExpiredException.class) public void testAuthNStatementWithExpiredSessionTime() throws Exception { AuthnStatement statement = helper.getValidAuthStatement(); DateTime past = new DateTime().minusMinutes(10); statement.setSessionNotOnOrAfter(past); profile.verifyAuthenticationStatement(statement, null, messageContext); }