Uploaded image for project: 'Keycloak'
  1. Keycloak
  2. KEYCLOAK-1823

Annoying behaviour of validations in user registration form



    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.5.0.Final
    • Fix Version/s: 1.6.0.Final
    • Component/s: None
    • Labels:


      I tested latest KC 1.5 snapshot today and there is annoying/incorrect behaviour of validations in registration form.

      Case 1 - validation errors are not shown at once for all fields

      I open registration page and hit submit, then I get one validation error "Please specify email.". OK, I specify it, submit, and now get two validation errors "Please specify first name." and "Please specify last name.". OK, I fill them, hit submit, but get "Please specify password." error. Arggh.

      All validation errors (at least for basic types of validations like mandatory fields and format of field value) should be shown at once to give user clear idea what have to be filled.

      Partial solution is to clone registration flow and move "Profile Validation" action before "Registration User Creation". This will perform basic email and first and last name validation together, but password presence validation is still separate.

      Case 2 - fails of email validation clear incorrect email value out of from field

      When I enter email in invalid format, or I use email address which is used by other user already, then validation error is shown in form (which is OK), but email value is cleared out of form field (it is blank), so user has no chance to patch wrong value, but have to type it whole again. It is always better for user to keep the incorrect value in form and let user to check/correct it without full retyping.

      Looking into code, this value clearing is done intentionally by formData.remove(Validation.FIELD_EMAIL); code in validate() methods of org.keycloak.authentication.forms.RegistrationProfile and org.keycloak.authentication.forms.RegistrationUserCreation classes!

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  velias Vlastimil Eliáš
                • Votes:
                  0 Vote for this issue
                  2 Start watching this issue


                  • Created: