{"id":990,"date":"2025-07-09T12:00:34","date_gmt":"2025-07-09T10:00:34","guid":{"rendered":"https:\/\/www.ume.li\/blog\/?p=990"},"modified":"2025-07-09T12:00:34","modified_gmt":"2025-07-09T10:00:34","slug":"remove-test-user-from-connections","status":"publish","type":"post","link":"https:\/\/www.ume.li\/blog\/2025\/07\/09\/remove-test-user-from-connections\/","title":{"rendered":"Remove Test User from Connections"},"content":{"rendered":"<p>I&#8217;ve been doing some tests with keycloak and automatic provisioning of users in HCL Connections.<br \/>\nBasically the user opens HCL Connections and gets redirected to the keycloak login page.<br \/>\nOn that page we have 2 options: regular login for Guests or Login through MS Entra\/or other IDP.<\/p>\n<p>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&#8217;s cleaned.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>To have a more sustainable testing process I had to clean the test accounts.<\/p>\n<p>Step 1: Delete the account from Keycloak\/LDAP<br \/>\nApache DS does a good job.<\/p>\n<p>Step 2: Delete the profile form HCL Connections<br \/>\nUsing wsadmin I&#8217;m able to deactivate a profile ( ProfilesService.inactivateUser ) but removing a user completely?<br \/>\nThe only way, without SDI, is to use the<a href=\"https:\/\/ds_infolib.hcltechsw.com\/ldd\/lcwiki.nsf\/xpAPIViewer.xsp?lookupName=HCL+Connections+8.0+API+Documentation#action=openDocument&#038;res_title=Profiles_Administration_API_80&#038;content=apicontent\" title=\"Profiles Administration API\" rel=\"noopener nofollow \" target=\"_blank\"> Profiles Admin API<\/a><\/p>\n<p><code><\/p>\n<p>var UserManager = {<br \/>\n   options: {<br \/>\n      method: 'delete',<br \/>\n      credentials: 'include',<br \/>\n      headers: {<br \/>\n         \"Content-Type\": \"application\/atom+xml\"<br \/>\n      }<br \/>\n   },<br \/>\n   deleteUsers: function (users) {<br \/>\n      users.forEach(UserManager.doDeleteUser);<br \/>\n   },<br \/>\n   doDeleteUser: async function (id, index) {<br \/>\n      if (!id) {<br \/>\n         return;<br \/>\n      }<br \/>\n      const url = `\/profiles\/admin\/atom\/profileEntry.do?userid=${id}`;<\/p>\n<p>      const response = await fetch(url, UserManager.options);<br \/>\n      if (response.ok) {<br \/>\n         console.log(`${index}: ${id}: Success`);<br \/>\n      } else {<br \/>\n         console.log(`${index}: ${id}: failed`);<br \/>\n      }<br \/>\n   }<br \/>\n}<br \/>\nUserManager.deleteUsers([\"94cff9ac-07a6-47bb-b140-9898a63d768e\",\"66df3530-0235-4017-ab74-379fad4c4cf0\"])<br \/>\n<\/code><\/p>\n<p>With this dangerous script it&#8217;s possible to remove multiple test accounts in one go. The function &#8220;UserManager.deleteUser&#8221; requires an array of ProfGUID&#8217;s as parameter. Prepare the script in your favorite editor and copy&#038;paste it into your favorite browsers WebDeveloper console. <\/p>\n<p>You need to be logged into HCL Connections as an admin user.<\/p>\n<p><strong>Caution<\/strong>: There&#8217;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.<\/p>\n<p><strong>Disclaimer<\/strong>: Use at your own risk !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been doing some tests with keycloak and automatic provisioning of users in HCL Connections. Basically the user opens HCL<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[127,93,92,24,126,125],"class_list":["post-990","post","type-post","status-publish","format-standard","hentry","category-connections","tag-account","tag-cnx","tag-cnx8","tag-connections","tag-delete","tag-profiles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/comments?post=990"}],"version-history":[{"count":2,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/990\/revisions"}],"predecessor-version":[{"id":992,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/990\/revisions\/992"}],"wp:attachment":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/media?parent=990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/categories?post=990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/tags?post=990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}