GaiaG
ZITADEL2y ago
8 replies
Gaia

Why an user with ORG_USER_SELF_MANAGER role cannot delete itself?

We want to implement a functionality for users to delete from zitadel on a certain scenario. Based on another message here Deleting user, the user needs to have the role ORG_USER_SELF_MANAGER and use the API of "Delete my user" (https://zitadel.com/docs/apis/resources/auth/auth-service-remove-my-user).

I already implemented an action (https://zitadel.com/docs/guides/manage/customize/behavior) on external and internal authentication in post creation for adding that role under the project that is being used (the only project under the org). I also verified that I can see the role for the user in the UI (see screenshot attached).

However, when calling the endpoint using the access token of the user, I get the following response:

{
    "code": 5,
    "message": "membership not found (AUTHZ-cdgFk)",
    "details": [
        {
            "@type": "type.googleapis.com/zitadel.v1.ErrorDetail",
            "id": "AUTHZ-cdgFk",
            "message": "membership not found"
        }
    ]
}


It makes sense as the user has no memberships, but as I understand that is for manager roles, and the user already has the correct role.
image.png
In this guide, you will create a ZITADEL action.
ZITADEL Docs
Was this page helpful?