for(Map.Entry<QName, List<String>> entry : entries){
final QName attrKey = entry.getKey();
final List<String> values = entry.getValue();
if (values != null && values.size() > 0){
if (STSAttributeProvider.NAME_IDENTIFIER.equals(attrKey.getLocalPart()) && subj == null){
final NameID nameId = samlFac.createNameID(values.get(0), attrKey.getNamespaceURI(), null);
subj = samlFac.createSubject(nameId, subjectConfirm);
idName = attrKey;
}
//else{
// final Attribute attr = samlFac.createAttribute(attrKey.getLocalPart(), attrKey.getNamespaceURI(), values);
// attrs.add(attr);
//}
}
}
if (idName != null){
claimedAttrs.remove(idName);
}
final List<Object> statements = new ArrayList<Object>();
//if (attrs.isEmpty()){
if (claimedAttrs.isEmpty()){
AuthnContext ctx = samlFac.createAuthnContext(this.authnCtxClass, null);
final AuthnStatement statement = samlFac.createAuthnStatement(issueInst, null, ctx, null, null);
statements.add(statement);
}else{
final AttributeStatement statement = samlFac.createAttributeStatement(null);
statements.add(statement);
}
final NameID issuerID = samlFac.createNameID(issuer, null, null);
// Create Assertion
assertion =
samlFac.createAssertion(assertionId, issuerID, issueInst, conditions, null, null, statements);
if (!claimedAttrs.isEmpty()){