Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid federated users idp domain being dropped when email as username is not enabled. #804

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1287,13 +1287,13 @@ public boolean isUsernameAlreadyTaken(String username, String tenantDomain) thro

if (StringUtils.isBlank(tenantDomain)) {
tenantDomain = MultitenantUtils.getTenantDomain(username);
// If tenant domain is not provided, domain from the username is assumed to be the tenant domain.
username = MultitenantUtils.getTenantAwareUsername(username);
}
try {
String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(username);

UserRealm userRealm = getUserRealm(tenantDomain);
if (userRealm != null) {
isUsernameAlreadyTaken = userRealm.getUserStoreManager().isExistingUser(tenantAwareUsername) ||
isUsernameAlreadyTaken = userRealm.getUserStoreManager().isExistingUser(username) ||
RushanNanayakkara marked this conversation as resolved.
Show resolved Hide resolved
hasPendingAddUserWorkflow(username, tenantDomain);
}
} catch (CarbonException | org.wso2.carbon.user.core.UserStoreException e) {
Expand Down
Loading