Skip to main content

Delete Users

The example-3 script authenticates an Integration Service client to manage Identities using the Admin identity created in example-0 and then performs the following tasks:

  1. Creates a new identity.
  2. Removes it from Integration Services.
  3. Verifies that the identity still exists on the Tangle.

You can run the example with the following command:

mvn exec:_java -Dexec.mainClass=net.gradbase.how_tos.DeleteUser

Example source code: Example-3

Remove User from Integration Services Database

You can remove an identity from the Integration Services backend by running the following script:

// Remove the user and also revoke the user's credentials
identityClient.remove(someIdentity.getId(), true);
note

You can only remove an identity in the Integration Services backend, the Identity cannot be removed from the Tangle.

Get an Identity Directly from the Tangle

You can retrieve an Identity from the Tangle by running the following script:

JSONObject recoveredIdentity = identityClient.latestDocument(someIdentity.getId());