Is it possible to create GeoServer users for a list of usernames (and associated passwords) in one batch? (similar to using the Linux newusers
command to create multiple users)
I've asked a related question about How to batch create GeoServer stores for each user?. It seems that that's possible with the GeoServer RESTful API.
But how about the GeoServer users themselves?
Can I also batch create the users as well?
I searched about REST API for creating users/roles, but couldn't find anything.
I've tried the Geofence rest API as suggested: I deployed both geoserver-2.8-SNAPSHOT-geofence-plugin.zip
and geoserver-2.8-SNAPSHOT-geofence-server-plugin.zip
, rebooted, and when I used the REST API with
curl -v -u admin:geoserver -X POST -H "Content-type: text/xml" -d "<User> <username>testu</username> </User>" http://localhost/geoserver/rest/usergroup/users
, I got the following error, no user is added. Any ideas what I am doing wrong or any suggestions? (I can't change the system configuration files, so REST API is preferable.)
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'admin'
> POST /geoserver/rest/usergroup/users HTTP/1.1
> Host: localhost
> Authorization: Basic XXXXXXXXXXXXXX
> User-Agent: curl/7.47.0
> Accept: */*
> Content-type: text/xml
> Content-Length: 41
>
* upload completely sent off: 41 out of 41 bytes
< HTTP/1.1 405 Method Not Allowed
< Date: Tue, 24 Jan 2017 04:57:58 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Allow: GET
< Content-Length: 0
<
* Connection #0 to host localhost left intact