The current implementation does not allow to create a user with all his attributes as it is possible to do with a REST call
curl -X POST 'http://demo.nuxeo.com/nuxeo/api/v1//user?' -H 'Nuxeo-Transaction-Timeout: 3' -H 'X-NXproperties: *' -H 'X-NXRepository: default' -H 'content-type: application/json' -d '{ "entity-type": "user", "id": "Bill1", "properties": { "lastName": "Murray", "username": "Bill1", "email": "bill@exemple.com", "company": "Nux", "firstName": "Bill", "password": "Nux2222", "groups": [ "members", "administrators" ] } }'
Password and tenantId are the missing field, as it is shown in the code below:
User user = new User(); List<String> groups = new ArrayList<>(); groups.add("members"); user.setEmail("bill@example.com"); user.setFirstName("Bill"); user.setLastName("Murray"); user.setUserName("bmurray2"); user.setCompany("Movies"); user.setGroups(groups); nuxeoClient.getUserManager().createUser(user);
User and UserProperties API must be updated.
Ideally we should keep the API open if it is needed to create users with a custom schema.
- depends on
-
NXP-19575 Remove password field from User json payload def
- Resolved
- is duplicated by
-
JAVACLIENT-114 Allow to create a user with a password
- Resolved
- is related to
-
JAVACLIENT-119 Add properties map for the entity User
- Resolved