Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sadilchamishka committed Oct 24, 2023
1 parent 5a692da commit 8a7d8c4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public boolean acceptInvitation(String confirmationCode) throws UserInvitationMg
invitation.getUsername(), invitedOrganizationId));
}

String userId = getRealUserId(invitation);
String userId = getInvitedUserId(invitation);
getOrganizationUserSharingService().shareOrganizationUser(invitedOrganizationId, userId,
invitation.getUserOrganizationId());
// Trigger event to add the role assignments if any available in the invitation.
Expand Down Expand Up @@ -351,7 +351,7 @@ private AbstractUserStoreManager getAbstractUserStoreManager(int tenantId) throw
return (AbstractUserStoreManager) tenantUserRealm.getUserStoreManager();
}

private String getRealUserId(Invitation invitation) throws UserInvitationMgtServerException {
private String getInvitedUserId(Invitation invitation) throws UserInvitationMgtServerException {

String userName = UserCoreUtil.addDomainToName(invitation.getUsername(), invitation.getUserDomain());

Expand All @@ -363,6 +363,7 @@ private String getRealUserId(Invitation invitation) throws UserInvitationMgtServ
String userManagedOrganizationClaim = OrganizationSharedUserUtil
.getUserManagedOrganizationClaim(userStoreManager, userId);
if (userManagedOrganizationClaim != null) {
// UserManagedOrg claim exist for the shared users. Hence, required to find the associated user ID.
String orgId = invitation.getUserOrganizationId();
invitation.setUserOrganizationId(userManagedOrganizationClaim);
return getOrganizationUserSharingService().getUserAssociation(userId, orgId).getAssociatedUserId();
Expand Down

0 comments on commit 8a7d8c4

Please sign in to comment.