KEYCLOAK-74 SaasServise fix

This commit is contained in:
vrockai 2013-09-27 16:09:33 +02:00
parent 32779d956a
commit a6bc0ff447

View file

@ -273,29 +273,8 @@ public class SaasService {
newUser.setUsername(formData.getFirst("username")); newUser.setUsername(formData.getFirst("username"));
newUser.setEmail(formData.getFirst("email")); newUser.setEmail(formData.getFirst("email"));
String fullname = formData.getFirst("name"); newUser.setFirstName(formData.getFirst("firstName"));
if (fullname != null) { newUser.setLastName(formData.getFirst("lastName"));
StringTokenizer tokenizer = new StringTokenizer(fullname, " ");
StringBuffer first = null;
String last = "";
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
if (tokenizer.hasMoreTokens()) {
if (first == null) {
first = new StringBuffer();
} else {
first.append(" ");
}
first.append(token);
} else {
last = token;
}
}
if (first == null)
first = new StringBuffer();
newUser.setFirstName(first.toString());
newUser.setLastName(last);
}
if (requiredCredentialTypes.contains(CredentialRepresentation.PASSWORD)) { if (requiredCredentialTypes.contains(CredentialRepresentation.PASSWORD)) {
newUser.credential(CredentialRepresentation.PASSWORD, formData.getFirst("password")); newUser.credential(CredentialRepresentation.PASSWORD, formData.getFirst("password"));