if (subjectConfData == null) {
if (!subjectConfirmationDataRequired
&& cs.getNotOnOrAfter() != null && !cs.getNotOnOrAfter().isBeforeNow()) {
return;
}
throw new NotAuthorizedException(errorResponse());
}
// Recipient must match assertion consumer URL
String recipient = subjectConfData.getRecipient();
if (recipient == null || !recipient.equals(getAbsoluteTargetAddress(m))) {
throw new NotAuthorizedException(errorResponse());
}
// We must have a NotOnOrAfter timestamp
if (subjectConfData.getNotOnOrAfter() == null
|| subjectConfData.getNotOnOrAfter().isBeforeNow()) {
throw new NotAuthorizedException(errorResponse());
}
//TODO: replay cache, same as with SAML SSO case
// Check address
if (subjectConfData.getAddress() != null
&& (clientAddress == null || !subjectConfData.getAddress().equals(clientAddress))) {
throw new NotAuthorizedException(errorResponse());
}
}