diff --git a/.changeset/tall-guests-rule.md b/.changeset/tall-guests-rule.md
new file mode 100644
index 00000000000..61dd1d7244f
--- /dev/null
+++ b/.changeset/tall-guests-rule.md
@@ -0,0 +1,5 @@
+---
+"@wso2is/identity-apps-core": patch
+---
+
+Disable input validation for usename in IS by default
diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp
index 054161b3aa7..6fd679d8b58 100644
--- a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp
+++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-process.jsp
@@ -66,6 +66,7 @@
String SELF_REGISTRATION_WITH_VERIFICATION_PAGE = "self-registration-with-verification.jsp";
String SELF_REGISTRATION_WITHOUT_VERIFICATION_PAGE = "* self-registration-without-verification.jsp";
String passwordPatternErrorCode = "20035";
+ String usernamePatternErrorCode = "20045";
String AUTO_LOGIN_COOKIE_NAME = "ALOR";
String AUTO_LOGIN_COOKIE_DOMAIN = "AutoLoginCookieDomain";
String AUTO_LOGIN_FLOW_TYPE = "SIGNUP";
@@ -378,7 +379,13 @@
request.getRequestDispatcher(SELF_REGISTRATION_WITHOUT_VERIFICATION_PAGE).forward(request,
response);
}
-
+ return;
+ } else if (usernamePatternErrorCode.equals(errorCode)) {
+ String i18Resource = IdentityManagementEndpointUtil.i18n(recoveryResourceBundle, errorCode);
+ if (!i18Resource.equals(errorCode)) {
+ request.setAttribute(ERROR_MESSAGE, i18Resource);
+ }
+ request.getRequestDispatcher("register.do").forward(request, response);
return;
} else {
if (!StringUtils.isBlank(username)) {
diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp
index e8c3999eb3b..de9d3eab276 100644
--- a/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp
+++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/self-registration-username-request.jsp
@@ -50,6 +50,8 @@
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.client.model.Claim" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.client.model.User" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.client.ValidationConfigurationRetrievalClient" %>
+<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.client.PreferenceRetrievalClient" %>
+<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.client.PreferenceRetrievalClientException" %>
<%@ page import="org.wso2.carbon.identity.core.util.IdentityTenantUtil" %>
<%@ page import="org.wso2.carbon.identity.core.ServiceURLBuilder" %>
<%@ page import="org.wso2.carbon.utils.multitenancy.MultitenantUtils" %>
@@ -91,7 +93,8 @@
boolean allowchangeusername = Boolean.parseBoolean(request.getParameter("allowchangeusername"));
boolean isPasswordProvisionEnabled = Boolean.parseBoolean(request.getParameter("passwordProvisionEnabled"));
boolean piisConfigured = false;
-
+ PreferenceRetrievalClient preferenceRetrievalClient = new PreferenceRetrievalClient();
+ boolean isSelfRegistrationLockOnCreationEnabled = preferenceRetrievalClient.checkSelfRegistrationLockOnCreation(tenantDomain);
String callback = Encode.forHtmlAttribute(request.getParameter("callback"));
String backToUrl = callback;
String sp = Encode.forHtmlAttribute(request.getParameter("sp"));
@@ -118,7 +121,7 @@
SelfRegistrationMgtClient selfRegistrationMgtClient = new SelfRegistrationMgtClient();
User user = IdentityManagementServiceUtil.getInstance().resolveUser(username, tenantDomain, isSaaSApp);
-
+ boolean isUsernameValidationEnabled = Boolean.parseBoolean(IdentityUtil.getProperty("InputValidation.Username.Enabled"));
ApplicationDataRetrievalClient applicationDataRetrievalClient = new ApplicationDataRetrievalClient();
try {
// Retrieve application Id.
@@ -531,10 +534,9 @@
- <% } else {
+ <% } else {
String logoPath = imageURL;
-
if (!imageURL.isEmpty() && imageURL.contains("/")) {
String[] imageURLSegements = imageURL.split("/");
String logoFileName = imageURLSegements[imageURLSegements.length - 1];
@@ -670,7 +672,7 @@
<% if(skipSignUpEnableCheck) {%> value="<%=Encode.forHtmlAttribute(username)%>" <%}%>>
<% if (emailPII != null) { %>