# When I rename "user name" and "email" and event "Remove user's application membership success " is sent

**URL:** <https://devforum.okta.com/t/when-i-rename-user-name-and-email-and-event-remove-users-application-membership-success-is-sent/23038>\
**Category:** API\
**Created:** [January 13, 2023, 12:47pm UTC](https://devforum.okta.com/t/when-i-rename-user-name-and-email-and-event-remove-users-application-membership-success-is-sent/23038 "2023-01-13T12:47:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![edimo.silva](https://avatars.discourse-cdn.com/v4/letter/e/67e7ee/32.png) [@edimo.silva](https://devforum.okta.com/u/edimo.silva)\
**Post date:** [January 13, 2023, 12:47pm UTC](https://devforum.okta.com/t/when-i-rename-user-name-and-email-and-event-remove-users-application-membership-success-is-sent/23038/1 "2023-01-13T12:47:56Z")

</div>

Hi, hope you are having a good day 🙂

I am facing an issue while working with event hooks on okta.  
When I rename “user name” and “email” I was expecting to receive one or two event hooks for “Updated user application property” but I receive and the events “Remove user’s application membership success” and “Add user to application membership”. Is that the expected behaviour? Is there a way of not triggering the event “Remove user’s application membership success” when the user is updated?

Steps to reproduce

1. I visit [Sign In](https://dev-XXXXXXX-admin.okta.com/admin/apps/active)
2. I click on my app
3. I click on the tab assignments
4. I click on Edit button
5. I change the values “User Name” and “Email” to “[admin\_new\_name@example.com](mailto:admin_new_name@example.com)”
6. I visit [Sign In](https://dev-XXXXXXX-admin.okta.com/report/system_log_2)  
The strange behaviour is
7. I see 2 events: the first is “Remove user’s application membership”, the second is “Add user to application membership”

note: this is relevant for us because we have hooks configured to do something when the event “Remove user’s application membership” is trigered via an EventHook.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 14, 2023, 12:58am UTC](https://devforum.okta.com/t/when-i-rename-user-name-and-email-and-event-remove-users-application-membership-success-is-sent/23038/2 "2023-01-14T00:58:19Z")

</div>

That’s likely because the application username is set to be the user’s username in Okta,and the username is being used as the unique ID for the users account on the SP side, so its treated as a new user and they have to be removed and pushed again

---

<div class="post-metadata">

**Author:** ![edimo.silva](https://avatars.discourse-cdn.com/v4/letter/e/67e7ee/32.png) [@edimo.silva](https://devforum.okta.com/u/edimo.silva)\
**Post date:** [January 16, 2023, 12:36pm UTC](https://devforum.okta.com/t/when-i-rename-user-name-and-email-and-event-remove-users-application-membership-success-is-sent/23038/3 "2023-01-16T12:36:42Z")

</div>

As developers we would like to prevent customers from triggering “Remove user’s application membership” while they are just updating a user, is there a way for that?

---

<div class="post-metadata">

**Author:** ![edimo.silva](https://avatars.discourse-cdn.com/v4/letter/e/67e7ee/32.png) [@edimo.silva](https://devforum.okta.com/u/edimo.silva)\
**Post date:** [January 18, 2023, 12:18pm UTC](https://devforum.okta.com/t/when-i-rename-user-name-and-email-and-event-remove-users-application-membership-success-is-sent/23038/4 "2023-01-18T12:18:14Z")

</div>

Hi @andrea , just checking if you have any news about this 🙂

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 12, 2024, 11:07pm UTC](https://devforum.okta.com/t/when-i-rename-user-name-and-email-and-event-remove-users-application-membership-success-is-sent/23038/5 "2024-02-12T23:07:34Z")

</div>


