Disable an RSA Authentication Manager user account using the Administration API
2 years ago
Originally Published: 2020-06-15
Article Number
000063784
Applies To
RSA Product Set: SecurID:
RSA Product/Service/Type: Authentication Manager SDK
Issue
The RSA Authentication Manager SDK administrative sample code shows how to enable a new user by implementing the PrincipalDTO.setEnabled() and the AddPrinicpalsCommand.

This article explains how to disable an existing user.
Resolution
The AdminAPIDemos sample code includes the updateUser method demonstrating how to use the UpdatePrincipalCommand and ModificationDTO classes.

This sample code pattern can be extended to include adding a ModificationDTO for the PrincipalDTO.ENABLE_FLAG:
 
...
//disable user
        mod = new ModificationDTO();
        mod.setOperation(ModificationDTO.REPLACE_ATTRIBUTE);
        mod.setName(PrincipalDTO.ENABLE_FLAG);
        mod.setValues(new Object[] { false });
        mods.add(mod); // add it to the list
...