Skip to content

Commit

Permalink
Merge pull request #13524 from dushaniw/master-4.4.x
Browse files Browse the repository at this point in the history
add changes for for account take over and email domain drop issue.
  • Loading branch information
RakhithaRR authored Oct 17, 2024
2 parents d1841d4 + 65cdfe1 commit 22937cd
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="org.owasp.encoder.Encode" %>
<%@ page import="org.wso2.carbon.identity.application.authentication.endpoint.util.Constants" %>
<%@ page import="org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils" %>
<%@ page import="org.wso2.carbon.identity.mgt.constants.SelfRegistrationStatusCodes" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.IdentityManagementEndpointConstants" %>
<%@ page import="org.wso2.carbon.identity.mgt.endpoint.util.IdentityManagementServiceUtil" %>
Expand All @@ -39,6 +40,7 @@
<%@ 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.core.util.IdentityTenantUtil" %>
<%@ page import="org.wso2.carbon.utils.multitenancy.MultitenantConstants" %>
<%@ page import="org.wso2.carbon.utils.multitenancy.MultitenantUtils" %>
<%@ page import="java.io.File" %>
<%@ page import="java.util.Arrays" %>
Expand All @@ -64,6 +66,7 @@
String username = request.getParameter("username");
String consentPurposeGroupName = "SELF-SIGNUP";
String consentPurposeGroupType = "SYSTEM";
String JIT = "JIT";
String[] missingClaimList = new String[0];
String[] missingClaimDisplayName = new String[0];
Map<String, Claim> uniquePIIs = null;
Expand Down Expand Up @@ -97,8 +100,18 @@
User user = IdentityManagementServiceUtil.getInstance().resolveUser(username, tenantDomain, isSaaSApp);
if (skipSignUpEnableCheck) {
consentPurposeGroupName = "JIT";
consentPurposeGroupName = JIT;
}
String tenantQualifiedUsername = username;
if (!MultitenantUtils.isEmailUserName() && FrameworkUtils.retainEmailDomainOnProvisioning() &&
consentPurposeGroupName == JIT && username.contains(IdentityManagementEndpointConstants.TENANT_DOMAIN_SEPARATOR) && tenantDomain != null) {
if (username.split(IdentityManagementEndpointConstants.TENANT_DOMAIN_SEPARATOR).length == 2) {
tenantQualifiedUsername = username + IdentityManagementEndpointConstants.TENANT_DOMAIN_SEPARATOR + tenantDomain;
}
}
User user = IdentityManagementServiceUtil.getInstance().resolveUser(tenantQualifiedUsername, tenantDomain, isSaaSApp);
if (StringUtils.isEmpty(username)) {
request.setAttribute("error", true);
request.setAttribute("errorMsg", IdentityManagementEndpointUtil.i18n(recoveryResourceBundle, "Pick.username"));
Expand Down

0 comments on commit 22937cd

Please sign in to comment.