return security;
}
//used from app client builder
public static DefaultPrincipal buildDefaultPrincipal(GerDefaultPrincipalType defaultPrincipalType) {
DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
defaultPrincipal.setRealmName(defaultPrincipalType.getRealmName().trim());
defaultPrincipal.setPrincipal(buildPrincipal(defaultPrincipalType.getPrincipal()));
GerNamedUsernamePasswordCredentialType[] namedCredentials = defaultPrincipalType.getNamedUsernamePasswordCredentialArray();
if (namedCredentials.length > 0) {
Set defaultCredentialSet = new HashSet();
for (int i = 0; i < namedCredentials.length; i++) {
GerNamedUsernamePasswordCredentialType namedCredentialType = namedCredentials[i];
NamedUsernamePasswordCredential namedCredential = new NamedUsernamePasswordCredential(namedCredentialType.getUsername(), namedCredentialType.getPassword().toCharArray(), namedCredentialType.getName());
defaultCredentialSet.add(namedCredential);
}
defaultPrincipal.setNamedUserPasswordCredentials(defaultCredentialSet);
}
return defaultPrincipal;
}