-
Suggestion
-
Resolution: Fixed
-
None
CWD-1469 introduced a REST API to manage user aliases.
Because aliases refer to usernames, they become orphaned when a user is renamed or deleted (CWD-2179). The orphans are difficult to track and eliminate, and they stay behind occupying the alias name and preventing new users (or the renamed user) from re-using the alias.
The current REST API (CWD-1469) offers a solution: the aliases can be listed, removed and added individually. However, if the number of applications is high, that involves 1+2N calls.
As a REST client, I would like to have an API in Crowd to change or delete all the aliases (for all applications) for a username.
Form Name |
---|
Since
CWD-1469, Crowd has supportedwhich returns a JSON object that maps applicationIds to aliases. Applications that do not support aliases or in which the user does not have an alias are not included in the response. If the user does not exist or does not have any alias, a 200 OK response with an empty JSON object is returned.
Now we add two methods two that resource:
Takes a JSON object that maps applicationIds to aliases. All the existing aliases of the username are removed, and only the new ones explicitly mentioned in the request are inserted. The aliases are inserted even if the username does not exist, or if it represents different users for different applications. If an applicationId is not explicitly mentioned in the request body, no alias will be inserted for that application and the previous alias for that username, if any, will cease to exist. If the request body mentions applicationIds that are not known to Crowd, they will be ignored.
Returns 204 on success.
Removes all the aliases registered for username, if any, in all the applications known to Crowd. Returns 204 on success.