final Set<Principal> principals = subject.getPrincipals();
final Map<QName, List<String>> attrs = new HashMap<QName, List<String>>();
if (principals != null){
final Iterator iterator = principals.iterator();
while (iterator.hasNext()){
final String name = principals.iterator().next().getName();
if (name != null){
List<String> nameIds = new ArrayList<String>();
nameIds.add(name);
attrs.put(new QName("http://sun.com", NAME_IDENTIFIER), nameIds);
break;
}
}
}
// Set up a dumy attribute value
final QName key = new QName("http://sun.com", "token-requestor");
List<String> tokenRequestor = new ArrayList<String>();
tokenRequestor.add("authenticated");
attrs.put(key, tokenRequestor);
return attrs;