From f38a5dc98a14b49874469c1dd0919a6d2ea5ec5b Mon Sep 17 00:00:00 2001 From: DilshanSenarath <74205483+DilshanSenarath@users.noreply.github.com> Date: Thu, 7 Nov 2024 23:07:48 +0530 Subject: [PATCH 1/3] fix the issue in the self-registration flow when the email address is configured as a unique value --- .../self-registration-with-verification.jsp | 62 ++++++++++++------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp index f657128161f..f7a75388f29 100644 --- a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp +++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-with-verification.jsp @@ -81,7 +81,6 @@ JSONObject usernameValidityResponse; String username = request.getParameter("username"); String password = request.getParameter("password"); - String emailValue = request.getParameter("username"); String consentPurposeGroupName = "SELF-SIGNUP"; String consentPurposeGroupType = "SYSTEM"; String[] missingClaimList = new String[0]; @@ -147,10 +146,16 @@ // Get validation configuration. ValidationConfigurationRetrievalClient validationConfigurationRetrievalClient = new ValidationConfigurationRetrievalClient(); JSONObject passwordConfig = null; + JSONObject usernameConfig = null; try { passwordConfig = validationConfigurationRetrievalClient.getPasswordConfiguration(tenantDomain); + usernameConfig = validationConfigurationRetrievalClient.getUsernameConfiguration(tenantDomain); } catch (Exception e) { - passwordConfig = null; + usernameConfig = null; + } + Boolean isAlphanumericUsernameEnabled = false; + if (usernameConfig.has("alphanumericFormatValidator")) { + isAlphanumericUsernameEnabled = (Boolean) usernameConfig.get("alphanumericFormatValidator"); } try { @@ -435,7 +440,7 @@ class="form-control required usrName usrNameLength">