GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.44k stars 1.13k forks source link

Setting correct Geonode/Geoserver security permissions for anon user to view layers #2933

Closed stevenvandervalk closed 7 years ago

stevenvandervalk commented 7 years ago

Hi. Thanks a lot for the project and active support on mailing lists here!

I'm currently stuck finding the right security permissions to let an anon Geonode user to view what should be public layers without having to disable security chains.

If I upload a layer using my admin user in geoserver-shell or QGIS plugin or simply through Geoserver Importer UI, when previewed in Geonode it works fine.

screenshot 2017-02-28 15 02 37

However when I visit it as not logged in user, the base layer renders but not the tiles with WFS features. I've set the "Anyone" button in the "Change Layer Permissions" UI in Geonode. E.g. screenshot 2017-02-28 15 05 52

I think this is the relevant query the map viewer is calling which suggests it should go through the default or rest security chains in Geoserver but amending neither one seems to be retained after a closing the UI and rebooting tomcat. Any advice on that weird behaviour?

http://geonode.connectedurbantropics.org/geoserver/wms?LAYERS=Testing%3ACreekwatch2014-15&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&TILED=true&SRS=EPSG%3A900913&BBOX=16319611.284727,-2191602.4746875,16358747.043203,-2152466.7162109&WIDTH=256&HEIGHT=256”

I'm currently using Geonode 2.4.1 and Geoserver 2.7.4. I installed from apt on Ubuntu 14.04 and added a custom geonode project for layout and contact forms.

Any advice or simply how to go about debugging this would be greatly appreciated!

Edit I just noticed http://docs.geonode.org/en/master/tutorials/advanced/geonode_settings/django-apps.html#geonode-security-geonode-granular-auth-backend which says by default anon users have no rights and I should set e.g AUTH_EXEMPT_URLS = ('/maps',). So should I be exempting '/wms' ?

simod commented 7 years ago

Hi, could be a connection issue between geoserver and geonode, if you set the layer as public, then it should be visible to anonymous users (no need to exempt anything). You installed geonode with apt-get right? Geoserver is the one installed by geonode by default. Check also if geoserver gives you any error when you try to set the permissions (from the geoserver ui -> logs).

ps, please use the mailing list geonode-users@lists.osgeo.org to ask for support.

stevenvandervalk commented 7 years ago

Hi @simod. Thanks for the reply and apologies I'll post on the mailing list.