diff --git a/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java b/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java index 8d69420525..6093879645 100755 --- a/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java +++ b/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java @@ -119,6 +119,10 @@ public class WelcomeResource { String password = formData.getFirst("password"); String passwordConfirmation = formData.getFirst("passwordConfirmation"); + if (username != null) { + username = username.trim(); + } + if (username == null || username.length() == 0) { return createWelcomePage(null, "Username is missing"); }