[GeoNode-users] Geonode & Geoserver - Secure WMS

Olivier Dalang olivier.dalang at gmail.com
Wed Jan 24 19:34:09 PST 2018


Hi,

We have very similar requirements here.

I'm currently trying to set this up by sharing user tables between Geonode
and Geoserver at database level rather than using OAuth2 calls.

It works like this :

1/ Create a JDBC user/group service
2/ Create a authkey authentication using "user properties" (this works by
reading a "UUID" property for each user)
3/ Change usersddl.xml to create updatable views instead of tables to
"proxy" django's tables so that they can be used by geoserver. This must be
done for user, user_props (to set the UUID to Django's tokens), and also
for groups. Another approach is not to create the tables at all, but
customize the queries (but it's more work in the end).
4/ Create a Django PasswordHasher so that Django and Geoserver's hashes are
compatible

This way, Geonode and Geoserver users are synced at the database level. It
means that Geoserver users/groups can be used through basic http
authentication (when connecting from a desktop GIS client for example) and
also when using a key in the URL (to display map tiles from the browser for
example). As Django tokens expire, it's not too bad if someone gets hold of
a token. And the nice thing is that if you use updatable views in postgres, you
can add/edit users/groups from within Geoserver or Geonode.

This whole idea seems works well (at least during my early tests), except
for step 4. I've been trying to setup Strong PBE Encryption for Django, but
couldn't make it work (see this thread
https://lists.osgeo.org/pipermail/geonode-users/2018-January/004059.html).
Currently, I'm using plain text passwords for my tests, but I'd definitely
need to sort step 4 out for this to be usable safely in production.

I'm just in the middle of this, so I don't have a nice code example to
share (besides what I shared in that other thread), but if this is of some
interest to you, I'll be happy to do so in a few days...

Kind regards,

Olivier






On Tue, Jan 23, 2018 at 9:02 AM, Pascal Coulon <Pascal.Coulon at scisys.co.uk>
wrote:

> Brilliant – very useful – exactly what we are about to implement. If this
> works as per explained we will feedback here.
>
>
>
> *Pascal Coulon *
>
> GIS Technical Architect - Enterprise Solutions & Defence
> *SCISYS UK Limited*
> T: +44 (0)117 9165237 | F: +44 (0)1249 465237 <+44%201249%20465237> | M:+44
> (0) 7876397844 <+44%207876%20397844>
> E: pascal.coulon at scisys.co.uk | http://www.scisys.co.uk
>
>
>
> *From:* Francesco Bartoli [mailto:xbartolone at gmail.com]
> *Sent:* 22 January 2018 20:59
> *To:* Alessio Fabiani
> *Cc:* Pascal Coulon; geonode-users at lists.osgeo.org
> *Subject:* Re: [GeoNode-users] Geonode & Geoserver - Secure WMS
>
>
>
> Never tried this https://github.com/GeoNode/geonode/pull/3415 but it
> should allow to get an access token from external applications.
>
>
>
> @Pascal, it is worth a look and maybe a PR for geonode docs on how to use
> it.
>
>
>
> Thanks
>
> Francesco
>
>
>
> Il giorno 22/gen/2018, alle ore 19:02, Alessio Fabiani <
> alessio.fabiani at geo-solutions.it> ha scritto:
>
>
>
> Hello Pascal,
>
> currently, without further customizations, the only way to access
> resources from external clients is by putting the valid OAUth2 access_token
> generated by GeoNode into the OWS request URL parameters.
>
>
>
> To retrieve this, you need to log into GeoNode, go to any layer details,
> click on "Download Layer" and copy the "access_token" query parameter from
> any of the generated query strings.
>
>
>
> There are plans to make it more easy for the users to retrieve the
> access_token from GeoNode in the future, but currently this is the only way
> to do this.
>
>
>
>
> Regards,
>
> Alessio Fabiani
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Ing. Alessio Fabiani
>
> @alfa7691
> Founder/Technical Lead
>
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313 <+39%200584%20962313>
> fax:     +39 0584 1660272 <+39%200584%20166%200272>
> mob:   +39 331 6233686 <+39%20331%20623%203686>
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
> AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
>
> Le informazioni contenute in questo messaggio di posta elettronica e/o
> nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
> loro utilizzo è consentito esclusivamente al destinatario del messaggio,
> per le finalità indicate nel messaggio stesso. Qualora riceviate questo
> messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
> darcene notizia via e-mail e di procedere alla distruzione del messaggio
> stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
> divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
> utilizzarlo per finalità diverse, costituisce comportamento contrario ai
> principi dettati dal D.Lgs. 196/2003.
>
> The information in this message and/or attachments, is intended solely for
> the attention and use of the named addressee(s) and may be confidential or
> proprietary in nature or covered by the provisions of privacy act
> (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
> Code).Any use not in accord with its purpose, any disclosure, reproduction,
> copying, distribution, or either dissemination, either whole or partial, is
> strictly forbidden except previous formal approval of the named
> addressee(s). If you are not the intended recipient, please contact
> immediately the sender by telephone, fax or e-mail and delete the
> information in this message that has been received in error. The sender
> does not give any warranty or accept liability as the content, accuracy or
> completeness of sent messages and accepts no responsibility  for changes
> made after they were sent or for other risks which arise as a result of
> e-mail transmission, viruses, etc.
>
>
>
> 2018-01-22 18:50 GMT+01:00 Pascal Coulon <Pascal.Coulon at scisys.co.uk>:
>
> Hello,
>
>
>
> I have a use case where I need to securely access OGC services managed by
> GeoNode, Geoserver and GeoFence. Access is required outside Geonode portal
> into third party application: desktop, other spatial web portal, etc.
>
>
>
> Geonode is used as the gateway to manage all datasets. On setting the
> permissions on a given datasets the relevant permissions are being pushed
> to GeoFence via its rest API. By default a ground data rule is set by
> default in GeoFence that prevent accessing / viewing all datasets; which
> means that then datasets would only be visible based on permissions set in
> GeoNode.
>
>
>
> The above part makes sense as long as one browses the data only in
> GeoNode. However, as soon as one wants to access the OGC end points in say
> QGIS / ArcMAP (e.g. wms, wfs) available on http://mydomain/geoserver/
> geonode/wms, you are not anymore authenticated. I have already looked
> into basic authentication; but as far as I understand it, this approach
> requires recreating the Geonode user in GeoServer.
>
>
>
> What are the options then for a desktop / third party application’s user
> to access the secure OGC end-points managed through Geonode? Which
> Geoserver authentication filter one should use?
>
>
>
> Hope this makes sense. Any thoughts or pointer would be greatly
> appreciated.
>
>
>
> Cheers,
>
>
>
> Pascal
>
>
>
>
>
> SCISYS UK Limited. Registered in England and Wales No. 4373530.
>
> Registered Office: Methuen Park, Chippenham, Wiltshire SN14 0GB, UK.
>
>
>
> Before printing, please think about the environment.
>
>
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>
>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>
>
>
> <http://gfidisc.scisys.co.uk>
>
>
> SCISYS UK Limited. Registered in England and Wales No. 4373530.
> Registered Office: Methuen Park, Chippenham, Wiltshire SN14 0GB, UK.
>
> Before printing, please think about the environment.
>
> <http://gfidisc.scisys.co.uk>
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/geonode-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20180125/76a76d74/attachment-0001.html>


More information about the geonode-users mailing list