How to delete the unconfirmed / duplicated MFA enrollments

Problem Statement

I want to get all the enrollments and delete the duplicated or unconfirmed ones because some users can’t do more enrollment after several failed attempts.

Cause

  1. if the user only triggers an enrollment request but does not confirm it, there will be a record in the authenticator list with active: false.
  2. Once the total number of authenticators reaches 51, the user cannot do any MFA enrollments.
  3. All the enrollment requests are accumulated with their own ID, every time a user clicks to enroll.

Solution

With Management API:

  1. Get enrollments with one of these options:
  1. Filter the “active: false” ones in case you have more than one option.
  2. Select the enrollment IDs to erase
  3. DELETE /api/v2/guardian/enrollments/:id