static {
SAMLSSOUtil.doBootstrap();
}
public Response buildResponse(SAMLSSOAuthnReqDTO authReqDTO, String sessionId) throws IdentityException {
Response response = new org.opensaml.saml2.core.impl.ResponseBuilder().buildObject();
response.setID(SAMLSSOUtil.createID());
response.setStatus(buildStatus(SAMLSSOConstants.StatusCodes.SUCCESS_CODE, null));
response.setVersion(SAMLVersion.VERSION_20);
DateTime issueInstant = new DateTime();
DateTime notOnOrAfter = new DateTime(issueInstant.getMillis() + 5 * 60 * 1000);
response.setIssueInstant(issueInstant);
response.getAssertions().add(buildSAMLAssertion(authReqDTO, notOnOrAfter, sessionId));
if (authReqDTO.getDoSignAssertions()) {
SAMLSSOUtil.setSignature(response, XMLSignature.ALGO_ID_SIGNATURE_RSA,
new SignKeyDataHolder(authReqDTO.getUsername()));
}
return response;