[Geoserver-users] Tutorial / Resources for setting up a REST API Client

Hi all,

I am currently trying to set up API Access to a geoserver server. I would like to use a separate user and role with limited access to avoid giving the API client admin access. The idea is to automatically upload new data and make it available using a script that I am currently developing.

Is there a proper way or a howto that I can follow? Googling only directs me to setups that seem to be unsafe like assigning the Admin role.

Cheers,
Simon

You can set the user up in the normal way (https://docs.geoserver.org/latest/en/user/security/index.html#security) and give them write permissions to any or all workspaces

Ian

ยทยทยท

Ian Turton

Dear Ian,

I have set up a Filter "Credentials From Request Headers" and added it to the rest filter chain. For some reason the Filter gets removed from the rest filter chain after returning to the settings after a few minutes. I am not sure what triggers this.

How can I make this setting persist?

The user has the role "DEPLOY_API_ROLE", which is added to security/rest.properties:

/rest/workspaces/**;GET,POST,DELETE,PUT=DEPLOY_API_ROLE

I tried to access the API using python requests library:

   result = requests.get(
     api_endpoint + "/workspaces/climate/datastores",
     headers={
       "X-Credentials" : "private-user=" + api_username,
       "X-Credentials" : "private-pw=" + api_password,
       #"accept" : "application/xml",
       #"content-type" : "application/json",
     }
   )

but only receive "403 Access Denied". Probably because the Filter is removed from the settings.

Am I missing something?

Cheers,
Simon

Am 01.11.23 um 11:27 schrieb Ian Turton:

You can set the user up in the normal way (https://docs.geoserver.org/latest/en/user/security/index.html#security) and give them write permissions to any or all workspaces

Ian

On Wed, 1 Nov 2023 at 10:06, Simon Michalke via Geoserver-users <geoserver-users@lists.sourceforge.net <mailto:geoserver-users@lists.sourceforge.net>> wrote:

    Hi all,

    I am currently trying to set up API Access to a geoserver server. I
    would like to use a separate user and role with limited access to avoid
    giving the API client admin access. The idea is to automatically upload
    new data and make it available using a script that I am currently
    developing.

    Is there a proper way or a howto that I can follow? Googling only
    directs me to setups that seem to be unsafe like assigning the Admin
    role.

    Cheers,
    Simon

    _______________________________________________
    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#/
    <http://www.ianturton.com/talks/foss4g.html#/&gt;
    - The GeoServer user list posting guidelines:
    http://geoserver.org/comm/userlist-guidelines.html
    <http://geoserver.org/comm/userlist-guidelines.html&gt;

    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
    <mailto:Geoserver-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/geoserver-users
    <https://lists.sourceforge.net/lists/listinfo/geoserver-users&gt;

--
Ian Turton