I’ve been doing some tests with keycloak and automatic provisioning of users in HCL Connections.
Basically the user opens HCL Connections and gets redirected to the keycloak login page.
On that page we have 2 options: regular login for Guests or Login through MS Entra/or other IDP.
If a user chooses MS Entra and he has not been provisioned in HCL Connections, the user will get an unpleasant error. And a crippled entry is in our database, which prevents any further login unless it’s cleaned.
Our HCL Connections servers run in a private cloud. Using SDI is not an option here to provision the users in our HCL Connections environments.
During the development of the new process, I ran a lot of tests. Resulting in a lot of test users. And testing with a productive MS Entra instance, there are only a limited amount of test accounts.
To have a more sustainable testing process I had to clean the test accounts.
Step 1: Delete the account from Keycloak/LDAP
Apache DS does a good job.
Step 2: Delete the profile form HCL Connections
Using wsadmin I’m able to deactivate a profile ( ProfilesService.inactivateUser ) but removing a user completely?
The only way, without SDI, is to use the Profiles Admin API
var UserManager = {
options: {
method: 'delete',
credentials: 'include',
headers: {
"Content-Type": "application/atom+xml"
}
},
deleteUsers: function (users) {
users.forEach(UserManager.doDeleteUser);
},
doDeleteUser: async function (id, index) {
if (!id) {
return;
}
const url = `/profiles/admin/atom/profileEntry.do?userid=${id}`;
const response = await fetch(url, UserManager.options);
if (response.ok) {
console.log(`${index}: ${id}: Success`);
} else {
console.log(`${index}: ${id}: failed`);
}
}
}
UserManager.deleteUsers(["94cff9ac-07a6-47bb-b140-9898a63d768e","66df3530-0235-4017-ab74-379fad4c4cf0"])
With this dangerous script it’s possible to remove multiple test accounts in one go. The function “UserManager.deleteUser” requires an array of ProfGUID’s as parameter. Prepare the script in your favorite editor and copy&paste it into your favorite browsers WebDeveloper console.
You need to be logged into HCL Connections as an admin user.
Caution: There’s no trash. HCL Connections will erase all traces from those users, across all apps. If the user has files, files shared with communities, all those will be erased too.
Disclaimer: Use at your own risk !