Skip to content

Commit

Permalink
Fix unwanted username conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Thumimku committed Jan 30, 2024
1 parent 19c9def commit 0d30b8b
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.core.util.UserCoreUtil;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

import java.io.IOException;
import java.util.ArrayList;
Expand Down Expand Up @@ -1290,8 +1289,7 @@ private void isUsernameExists(AuthenticationContext context, String username)
UserRealm realm = getUserRealm(context.getTenantDomain());
UserStoreManager userStoreManager = getUserStoreManager(context.getExternalIdP()
.getProvisioningUserStoreId(), realm, username);
String sanitizedUserName = UserCoreUtil.removeDomainFromName(
MultitenantUtils.getTenantAwareUsername(username));
String sanitizedUserName = UserCoreUtil.removeDomainFromName(username);
if (userStoreManager.isExistingUser(sanitizedUserName)) {
// Logging the error because the thrown exception is handled in the UI.
log.error(ErrorMessages.USER_ALREADY_EXISTS_ERROR.getCode() + " - "
Expand Down

0 comments on commit 0d30b8b

Please sign in to comment.