Delete User after it has expired

I want to delete/deactivate users after these have expired.
Question 1 What is the best way to set a new property ‘expiredDate’ that cannot be changed by the users itself.
Question 2: Is there a way to look over all users let’s say once every day and if a user is expired delete this account?

Thank you in advance,
Daniel

The problem is date functions in Okta expression language, as there are none. But I think you can add a field of type String and put there an expiry date in the predetermined format, like ‘05-05-2021’. Then use a group and a group rule, to determine if today’s date converted into a string in the required format is equal to user’s ‘expiryDate’, to put this user into the group. Then you can easily use Workflow automation to deactivate/delete user based on their membership in a group

1 Like

How is it possible to set a custom field via the PHP api?

$profile->setLogin("asdf@jklo.com");
$profile->expirationDate("1234");
$user->setProfile($profile);

Is there a filed “Customs” or what can I use?
Thanks!

Best regards,
Daniel

I never tried it with PHP, but from the documentation it seems it can be $profile->custFieldName. You can try, I guess (GitHub - okta/okta-sdk-php: PHP SDK for the Okta API)

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.