Skip to content

Commit

Permalink
Enable the listener and improve org extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanChathusanda93 committed Oct 6, 2023
1 parent b531c27 commit 42544c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
org.wso2.carbon.identity.event; version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.identity.event.services; version="${carbon.identity.package.import.version.range}",
org.wso2.carbon.identity.organization.management.service; version="${org.wso2.identity.organization.mgt.core.imp.pkg.version.range}",
org.wso2.carbon.identity.organization.management.service.constant; version="${org.wso2.identity.organization.mgt.core.imp.pkg.version.range}",
org.wso2.carbon.identity.organization.management.service.util;version="${org.wso2.identity.organization.mgt.imp.pkg.version.range}",
org.wso2.carbon.identity.organization.management.service.exception;version="${org.wso2.identity.organization.mgt.imp.pkg.version.range}",
org.wso2.carbon.user.api;version="${carbon.user.api.imp.pkg.version.range}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import java.util.Map;
import java.util.UUID;

import static org.wso2.carbon.identity.organization.management.service.constant.OrganizationManagementConstants.ErrorMessages.ERROR_CODE_ORGANIZATION_NOT_FOUND_FOR_TENANT;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.CLAIM_EMAIL_ADDRESS;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.CLAIM_MANAGED_ORGANIZATION;
import static org.wso2.carbon.identity.organization.user.invitation.management.constant.UserInvitationMgtConstants.DEFAULT_PROFILE;
Expand Down Expand Up @@ -353,6 +354,13 @@ public boolean deleteInvitedUserAssociation(String userId, UserStoreManager user
try {
authenticatedOrganizationId = organizationManager.resolveOrganizationId(authenticatedTenant);
} catch (OrganizationManagementException e) {
// This is to handle the scenario where the tenant is not modeled as an organization.
if (ERROR_CODE_ORGANIZATION_NOT_FOUND_FOR_TENANT.getCode().equals(e.getErrorCode())) {
if (LOG.isDebugEnabled()) {
LOG.debug("Organization not found for the tenant: " + authenticatedTenant);
}
return true;
}
throw new UserInvitationMgtServerException(ERROR_CODE_GET_ORG_ID_FROM_TENANT.getCode(),
ERROR_CODE_GET_ORG_ID_FROM_TENANT.getMessage(),
String.format(ERROR_CODE_GET_ORG_ID_FROM_TENANT.getDescription(), authenticatedTenant), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,4 @@ public boolean doPreSetUserClaimValueWithID(String userID, String claimURI, Stri
}
return true;
}

@Override
public boolean isEnable() {

return false;
}
}

0 comments on commit 42544c1

Please sign in to comment.