subjectConfirmationData.setNotOnOrAfter(SamlUtils.getXMLGregorianCalendarNowPlusDuration(GregorianCalendar.MINUTE, ASSERTION_VALIDITY_IN_MINUTES));
subjectConfirmationData.setInResponseTo(samlDialogue.get().getExternalProviderMessageId());
ConditionsType conditions = assertionObjectFactory.createConditionsType();
assertion.setConditions(conditions);
AudienceRestrictionType audienceRestriction = assertionObjectFactory.createAudienceRestrictionType();
conditions.getConditionOrAudienceRestrictionOrOneTimeUse().add(audienceRestriction);
audienceRestriction.getAudience().add(samlDialogue.get().getExternalProvider().getEntityId());
AuthnStatementType authnStatement = assertionObjectFactory.createAuthnStatementType();
assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(authnStatement);
authnStatement.setAuthnInstant(SamlUtils.getXMLGregorianCalendarNow());
authnStatement.setSessionIndex(((SamlIdpSessionImpl) session).getSessionIndex());