[Geoserver-users] Security with REST API

Hi All,

I am trying to create security rules on GeoServer through the REST API, I am trying to create the tutorial steps of the link below via REST, however, I am not getting success.

https://docs.boundlessgeo.com/suite/1.1.1/sysadmin/security/multiuser/index.html

I was able to create users and workspaces without problems, but when I get to the ROLES, it gives an error. The closest to creating that I got was this way:

curl -v -u admin:geoserver -XPOST -H “Content-type: text/xml” -d “ROLE_EDIT” http://localhost:8080/geoserver/rest/security/roles

And the GeoServer returned the following message to me: HTTP / 1.1 405 Method Not Allowed

What am I doing wrong? Is it possible to create ROLES and set permissions via REST?

···

Best Regards,

Fernando Quadro
http://www.fernandoquadro.com.br
https://www.linkedin.com/in/fernandoquadro/

That documentation is not provided by the community, we would welcome the contribution of an example once you get it working.

I encourage you to check the test cases, for that specific rest end point, as a good place to find a working/tested example.

···


Jody Garnett

Hi Fernando,

To create a new role I am using the following endpoint:

POST
Headers:
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: Basic your-authorization

https://www.your.geoserver.url.com/rest/security/roles/role/

Hope this helps.
Cheers.

···

Samy Otero

PSD | Software Developer

www.psdrcs.com

London | 148 Fullarton St. 9th floor.

Burlington | 5045 South Service Rd.