ftos.identity.users.deleteTemporary
Starting with v24.3, this is renamed from server.b2c.deleteTemporaryIdentity to ftos.identity.users.deleteTemporary.
Deletes temporary identities created in B2C sessions. You need admin rights to run this function. This function checks the AnonymousUserLifespanDays property found in the B2C portal configuration.
This function only removes temporary users, not other types of users, such as: system users, service accounts, etc.
This is suitable for business logic modules of business service components.
Syntax
function ftos.identity.users.deleteTemporary(userId: string): void
| Parameter | Description |
|---|---|
userId
|
The Id of the temporary user to be deleted. One or more users can be added as parameter. |
Return Value
Returns an object with the results of the operation:
-
IsSuccess:trueorfalse -
Message: error message ifIsSuccess:false.
Examples
In this example, we use the ftos.identity.users.deleteTemporary function to delete several temporary users:
- Create a server script with the following code which includes the temporary userID to be deleted:Copy
var result = ftos.identity.users.deleteTemporary("837ef684-3bca-6x37-9b50-7032911a3b58");
ftos.context.response.setData(result.message); - Create an endpoint for this script.
- Execute the script with an admin user.
- Check the logs and the FintechOS IDP to see the user was deleted.