You need the following steps
Step 1: Enabling the Delete Account Capability
- Click Authentication in the menu.
- Click the Required Actions tab.
- Select Enabled on the Delete Account
Step 2: Add the delete-account role eihter to an user (Option 1 ) or to a default role ( Option 2)
Option 1: Giving a user the delete-account role
- Click Users in the menu.
- Select a user.
- Click the Role Mappings tab.
- From the Client Roles list, select account.
- Under Available Roles, select delete-account.
- Click Add selected.
Once you have the delete-account role, you can delete your own account.
Option 2: Adding a default Group with delete-account role
Default Groups
Default groups allow you to automatically assign group membership whenever any new user is created or imported through User Storage Federation or Identity Brokering. To specify default groups go to the Groups
left menu item, and click the Default Groups
tab
Add delete-account role to the new Default Group
ADD newly created Default Group to Default Groups
Delete your account
- Log into the Account Console via Url : http://localhost:8280/auth/realms/RBAC/account/#/personal-info
- At the bottom of the Personal Info page, click Delete Account.
- Click on Delete
- Note: You need to login again with Username and Password
- Finally confirm the account deletion process
Code for Angular App
ngOnInit(): void { window.location.href = environment.keycloakURL + 'realms/RBAC/account/#/personal-info'; }
Reference
- For Details read Chapter 5. Managing Users -> Enabling account deletion by users from
- https://www.keycloak.org/docs/latest/server_admin/
- https://www.zakariaamine.com/2020-12-13/got-keyckloak-953-merged
- keycloak-documentation/allow-user-to-delete-account.adoc at main · keycloak/keycloak-documentation · GitHub
Be First to Comment