I created a user, password and a role, granted access to the layer 'myfeature' only for that role. Now I want to test whether the access restriction works, but I cannot find any documentation about how the parameters must be set for user access in a ordinary WFS request.

however, neither:




work, unless I disable the access restriction.


It is dependent on the tool you are using for the POST, but there are examples in the GeoServer documentation (e.g. http://docs.geoserver.org/latest/en/user/security/tutorials/digest/index.html).

In curl, it is -u myusernamer:mypassword, in wget, it is --user myusernamer --password mypassword (same convention as in the question).

In the browser, it will usually be something like: http://myusernamer:mypassword@mygeoserver/wfs?service=wfs&version=2.0.0&request=GetFeature&typeNames=myworkspace:myfeature

For programming libraries, it will be different again, but that isn't really anything GeoServer (or GIS) specific, so you might want to ask on a programming-language specific site.

|improve this answer|||||
  • thanks a lot! But how would I do that with a plain url in the browser? – Ferenjito May 2 '16 at 11:43
  • 1
    Updated answer to show browser example (still not GeoServer specific though) – BradHards May 3 '16 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.