# How to allow users to only update/delete their accounts through the management api

**URL:** <https://community.auth0.com/t/how-to-allow-users-to-only-update-delete-their-accounts-through-the-management-api/100792>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [February 18, 2023, 12:48pm UTC](https://community.auth0.com/t/how-to-allow-users-to-only-update-delete-their-accounts-through-the-management-api/100792 "2023-02-18T12:48:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reda](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@reda](https://community.auth0.com/u/reda)\
**Post date:** [February 18, 2023, 12:48pm UTC](https://community.auth0.com/t/how-to-allow-users-to-only-update-delete-their-accounts-through-the-management-api/100792/1 "2023-02-18T12:48:03Z")

</div>

As a rookie building their first app, I used react + flask which uses auth0 to manage users.  
I used this setup that does not require an API token in my front-end client I just forward the token to my backend API and it does the job.

Now my issue is any user can alter the request and send a delete or update request to my server with someone’s else id and the API will delete that user.  
How can I make my backend check if the token passed and only delete or update that user if the token was actually issued to the user they trying to edit or delete?

If this has already an easy solution please don’t mind me as I stated before I’m still a rookie 😄

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 22, 2023, 2:54am UTC](https://community.auth0.com/t/how-to-allow-users-to-only-update-delete-their-accounts-through-the-management-api/100792/3 "2023-02-22T02:54:30Z")

</div>

Hey there @reda !

> [@reda](#):
>
> I used this setup that does not require an API token in my front-end client I just forward the token to my backend API and it does the job.

Are you able to elaborate on what you mean here? How are you obtaining this token and what exactly do you mean by API token?

> [@reda](#):
>
> Now my issue is any user can alter the request and send a delete or update request to my server with someone’s else id and the API will delete that user.  
> How can I make my backend check if the token passed and only delete or update that user if the token was actually issued to the user they trying to edit or delete?

No user should have access to a Management API token if this is what you are referring to - These should be handled on a backend strictly.

If you haven’t already I definitely recommend checking our our architecture docs to help get a high level overview of what you are looking to achieve. Most common use cases are outlined here:

> **[Architecture Scenarios](https://auth0.com/docs/get-started/architecture-scenarios)**
>
> Learn about common Auth0 architecture scenarios that you can use to solve your authorization and authentication needs.

The more information you can share on your environment and desired use case the better. Keep us posted!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 9, 2023, 1:24am UTC](https://community.auth0.com/t/how-to-allow-users-to-only-update-delete-their-accounts-through-the-management-api/100792/4 "2023-03-09T01:24:09Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
