Skip to content

Keycloak using AIA to delete your own account

Keycloak Setup

Default Roles

Relam Default Roles

Allowing users to self-register

New Login Window should show up a Self Registration Button

Enabling account deletion by users

Enable Delete Account Feature in Authentication -> Required Action
Add Delete Account Role for that specific User

Angular Code

export class AccountSelfDeletionComponent implements OnInit {
  private logHeader = '';

  constructor(public accountService: AccountService,
              public messageService: MessageService,
    ) {}

  ngOnInit(): void {
    this.logHeader = "[AccountSelfDeletionComponent:ngOnInit()] ";
    this.messageService.add(this.logHeader + 'Inside   ngOnInit')
    window.location.href = "http://localhost:8280/auth/realms/RBAC/account/#/personal-info";
  }

}

App Testing

  • After invoking Angular Compoment AccountSelfDeletionComponent you get redirect to :
  • http://localhost:8280/auth/realms/RBAC/account/#/personal-info
  • This page hosts an Delete Account Button
  • After pressing this Button a Red Delete Button shows up and you can finally start the account deletion prorcess
Star Account Deletion Process
Login again to get confirmation Message
Finally confirm account deletion
Status of account Deletion Request
After pressing Back to Application Link

Links

Published inKeycloak

Be First to Comment

Leave a Reply