Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have Geoserver 2.1.3 set up for WFS transaction. I am using basic authentification and I have set up the following:

  • A role(ROLE_RMP_WFS)
  • A user(user_rmp) which belongs to the role above
  • Data security where rmp..w is set to the role above and rmp..r is set to *
  • No service security
  • Catalog mode config set to mixed

I can query the layer with WFS just fine.

However, doing a insert post transaction through OpenLayers with the URL _http://user_rmp:rmppassword@kart10utv.ad.skogoglandskap.no/geoserver_ekstern/wfs/ fails with the following message:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/ows    http://kart10utv:80/geoserver_ekstern/schemas/ows/1.0.0/owsExceptionReport.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:ows="http://www.opengis.net/ows">
<ows:Exception exceptionCode="InvalidParameterValue">
<ows:ExceptionText>Error performing insert: Cannot access rmp_kartobjekt_flate_v with the current privileges</ows:ExceptionText>
 </ows:Exception>
</ows:ExceptionReport>

However, the object is inserted just fine running the same query in CURL: curl -vv --header "Content-Type:text/xml" -X POST -d @feature.xml _http://user_rmp:rmppassword@kart10utv.ad.skogoglandskap.no/geoserver_ekstern/wfs

The feature.xml is the same as the POST content: http://pastebin.com/yPwFb9g7

I do not understand why it works using CURL, but not working using a regular browser?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

For Geoserver 2.1.3

By default, no service-level security is set. Two examples are given in the service.properties file by default, commented out:

wfs.GetFeature=ROLE_WFS_READ

wfs.Transaction=ROLE_WFS_WRITE

Make Sure they are included for WFS_T

http://docs.geoserver.org/2.1.3/user/security/sec_service.html

Example Service File with the correct security for anonymous use

http://docs.geoserver.org/stable/en/user/_sources/security/service.txt

Note: Restart Geoserver after the file has been edited.

share|improve this answer
    
Ok, I set the role ROLE_RMP_WFS to wfs.Transaction and then it worked in my browser as well. But I still do not understand why it worked using CURL without this setting when it did not work in my browser. Thanks a lot! –  Espen Oct 29 '12 at 9:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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