adobe-apiplatform / user-sync.py

Application for synchronizing Adobe customer directories via the User Management API
https://adobe-apiplatform.github.io/user-sync.py/en/user-manual/
MIT License
87 stars 67 forks source link

users not processed correctly when username and email have different domains #808

Closed cbalanoiu closed 1 year ago

cbalanoiu commented 1 year ago

Description Users are not processed correctly when username and email have different domains when removing from file.

Steps to reproduce When using write-to-file the tool exports [type,username,domain] When removing from file (--adobe-only-user-list users-to-delete.csv --adobe-only-user-action delete) the username value is compared to the email

Expected behavior The tool should compare corresponding values , i.e. have a case for username and email with different domains.

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2022-12-05 at 14 10 10 Screenshot 2022-12-05 at 14 13 36

Environment

adorton-adobe commented 1 year ago

The central issue is that the UMAPI expects the user to be identified by email address and not username.

I've resolved this issue by modifying the write function to write the email address of each user instead of the username. The read function has been modified to look for the email address first and only try the username if the email address is not provided. This maintains backward compatibility.

It now logs a warning if the username is being used to identify a user.

See https://github.com/adobe-apiplatform/user-sync.py/commit/651d2117150d59030276297867eeef2d6c09093b for more info.