responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);
//Add information on the roles
AssertionType assertion = (AssertionType) responseType.getAssertionOrEncryptedAssertion().get(0);
AttributeStatementType attrStatement = saml2Response.createAttributeStatement(roles);
assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attrStatement);
//Add timed conditions
saml2Response.createTimedConditions(assertion, assertionValidity);
//Add in the attributes information
if(this.attributeManager != null)
{
try
{
Map<String, Object> attribs =
attributeManager.getAttributes(userPrincipal, this.attribKeys);
AttributeStatementType attStatement = StatementUtil.createAttributeStatement(attribs);
assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(attStatement);
}
catch(Exception e)
{
log.error("Exception in generating attributes:",e);