Hi fellow GeoServer lovers

I would like to programatically add new users to a GROUP by using the REST
API.  While the documentation at
https://docs.geoserver.org/latest/en/user/rest/index.html#rest is not
perfect (and I hope to update it once I understand how to make the
request), I can make a POST to /geoserver/rest/*security*/usergroup/users/
with application/json body:

{
 "org.geoserver.rest.security.xml.JaxbUser":{
  "userName": "username",
  "password": "password",
  "enabled": true
 }
}

and this returns 201 Created.

For others wanting to do the same, please take note of the configuration
patch required:
https://gis.stackexchange.com/questions/256891/creating-new-geoserver-user-through-rest-api/276906#276906

My question comes in: how do I programatically add this user to a
particular GROUP?

It can only be a separate endpoint, as when I request all users (GET to
/geoserver/rest/security/usergroup/users/ ) it returns users and enabled
(passwords are hidden fortunately!) but not which Groups or Roles
assosicated with those users.

/geoserver/rest/security/usergroup/groups/ returns Groups, but no links to
users.
/geoserver/rest/security/roles/ - similar.

I am not using GeoFence (or should I really be doing so?)

Please help me figure this out and I will then update the documentation
accordingly.

Thanks

Peter
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to