We have an external identity management system which has to manage the lifecycle of users in CQ5 using Sling and REST.
We are able to create and delete users and groups with
Create
POST http://$host:$port/libs/cq/security/authorizables/POST Content: rep:[email protected]&givenName=Example&familyName=Example&[email protected]&rep:password=random
Delete
POST http://$host:$port/home/users/e/[email protected] Content: deleteAuthorizable=1
Our problem is that we did not find out how to rename a user (or a group).
How can we rename a user?
The only solution we found would be to
- list all the group memberships of a user
- delete the user
- create a new user
- recreate all the group memberships
Although this solution could work it will most likely pose some performance problems (we have more than 70K users and more than 15K groups). If this is the only solution: how can we perform the first step (list all the memberships) efficiently via REST