Issue with User API and REST API

I’m fairly new to xWiki and working with APIs. There are a few things that I don’t seem to grasp yet.

I’m attempting to manipulate Users and User Groups through the REST API.
I want to automate the user management from another app (creating users, changing their rights and groups, etc.) and am trying to understand the syntax I would need for that.

I created a new user profile via

PUT http://ip:port/xwiki/rest/wikis/xwiki/spaces/XWiki/pages/testuser

and added the object

POST http://ip:port/xwiki/rest/wikis/xwiki/spaces/XWiki/pages/testuser/objects

but I can’t log in with that user and it’s not available through the user directory.

I found the User API documentation, but I don’t quite understand how to use it…
It says there:

  1. Direct XWiki.XWikiUsers XObject access: This is totally not recommended and you shouldn’t do that. Use this API instead.

which is what I guess I did… I don’t understand how to access UserProperties via REST API, though.

I’ve been sitting on this problem a few days now and can’t seem to get anywhere.
Any help is greatky appreciated!

I think you also need to add your user to the XWiki.XWikiAllGroup. Basically you need to mimick this:

We should provide a REST API to create a user. Feel free to create a jira issue to log an improvement about this!