Closed s3lph closed 1 year ago
We're using umapi_client to sync local users to UMAPI federatedID users. One use case in this sync is renaming users.
When renaming a user, we want to change both the username and the email of the federatedID user, which umapi_client forbids.
user_action.update(email=lu.email, username=lu.email) con.execute_single(user_action)
However, this fails due to this check in UserAction.update:
UserAction.update
https://github.com/adobe-apiplatform/umapi-client.py/blob/74e8c1e13e45070e112c88804a8057af639f57dd/umapi_client/functional.py#L180-L181
So we tried to follow the instructions in this error message (it claims that when chaning the email, the username will be changed as well):
user_action.update(email=lu.email) con.execute_single(user_action)
However, the username is in fact not updated. Effectively, this prevents the affected user from logging in:
Trying to set the username separately from the email fails due to another check in UserAction.update:
https://github.com/adobe-apiplatform/umapi-client.py/blob/74e8c1e13e45070e112c88804a8057af639f57dd/umapi_client/functional.py#L178-L179
So we tried to circumvent this check:
user_action.update(email=local_user.email) user_action.commands[-1]['update']['username'] = local_user.email con.execute_single(user_action)
And see there, it works: Both the username and the email are updated, and the user can log in again.
Renaming a federatedID user should work without having to circumvent erroneous client-side checks:
username
email
I'll take a look. While I do that will you please test this in v2.20 which is the latest version? Not sure it will resolve the issue but it may.
Description
We're using umapi_client to sync local users to UMAPI federatedID users. One use case in this sync is renaming users.
When renaming a user, we want to change both the username and the email of the federatedID user, which umapi_client forbids.
Actual Behavior
However, this fails due to this check in
UserAction.update
:https://github.com/adobe-apiplatform/umapi-client.py/blob/74e8c1e13e45070e112c88804a8057af639f57dd/umapi_client/functional.py#L180-L181
So we tried to follow the instructions in this error message (it claims that when chaning the email, the username will be changed as well):
However, the username is in fact not updated. Effectively, this prevents the affected user from logging in:
Trying to set the username separately from the email fails due to another check in
UserAction.update
:https://github.com/adobe-apiplatform/umapi-client.py/blob/74e8c1e13e45070e112c88804a8057af639f57dd/umapi_client/functional.py#L178-L179
So we tried to circumvent this check:
And see there, it works: Both the username and the email are updated, and the user can log in again.
Expected Behavior
Renaming a federatedID user should work without having to circumvent erroneous client-side checks:
username
andemail
to be updatedemail
is provided.Environment