Uploaded image for project: 'Crowd'
  1. Crowd
  2. CWD-5160

Crowd does not use the user unique identifier attribute when synchronizing duplicate users with different case

    XMLWordPrintable

    Details

      Description

      Summary

      In a scenario in which a user exists multiple times in an external directory, but each time with a different case in the username - thus having a unique identifier for each instance of the user, Crowd will try to add all instances of the user to the cwd_user table, as expected.
      However, due to the constraint we have in the cwd_user table, Crowd will consider only the lower_user_name + directory_id to make sure that the user is unique, while in fact, the user is already unique if we consider the external_id value and the user_name with case sensitive.

      Steps to Reproduce

      1. Create a user called MyUser in an external LDAP;
      2. Create a user called myuser in the same external LDAP;
      3. Synchronize the directory in Crowd using a Unique Identifier (e.g. objectGUID if using AD).

      Expected Results

      Both users should be synchronized in Crowd since they are different users in the LDAP (Unique Identifier proves that).

      Actual Results

      The below exception is thrown in the atlassian-crowd.log file:

      Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into cwd_user (user_name, lower_user_name, active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address, external_id, directory_id, credential, id) values ('myuser', 'myuser@example.com', 'T', '2018-05-17 15:40:12.438000+00', '2018-05-17 15:40:12.438000+00', 'myuser', 'myuser', 'myuser', 'myuser', 'myuser myuser', 'myuser myuser', 'myuser@example.com', 'myuser@example.com', '200fe242cfdcca2da1a3a4101e0a2f00', 21364739, 'nopass', 21970896) was aborted: ERROR: duplicate key value violates unique constraint "uk_user_name_dir_id"
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              emallmann Eduardo Mallmann (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: