<div dir="ltr"><div><div>Hi Francesco,<br><br></div>Thank your for your message.</div><div><br></div><div>After a little bit of research (I'm not familiar with LDAP), it seems well documented an mature on Geoserver [1], but I'm a bit less sure about Geonode.
Have you done that before ?
<br></div><div><br></div><div>In particular, I have those concerns: <br></div><div>- Would groups be supported ? From this thread [2] in early 2017, it doesn't seem to be the case. I see in the django-auth-ldap documentation [3] that it's possible to mirror groups, but as Geonode has it's own people_profile_groups table, I'm not sure it would work with Geonode out of the box.<br></div><div>- I couldn't find out whether django-auth-ldap is bidirectional or not (will it still be possible to add/edit/delete users from the Django app ?).</div><div><br></div><div>About the approach being too complex, the only tricky part in that setup is the encryption.</div><div>I initially thought there would be reliable python libraries to hash passwords using PBEWITHSHA256AND256BITAES-CBC, but it seems that algorithm is only popular in the java world. Actually it may be easier/cleaner to go the other way around (add a django-comptabile password hasher to geoserver).<br></div><div><br></div><div> Except that, it's just using existing postgres tables for authentication, which is very well supported by Geoserver, and not very different conceptually from using any other external authentication system (like LDAP), with the added benefit that there's only one integration to manage.<br></div><div><br></div><div>Kind regards,</div><div><br></div><div>Olivier<br></div><div></div><div></div><div><br></div><div>[1]
<a href="http://docs.geoserver.org/latest/en/user/security/tutorials/ldap/index.html">http://docs.geoserver.org/latest/en/user/security/tutorials/ldap/index.html</a> <br></div><div>[2]
<a href="https://lists.osgeo.org/pipermail/geonode-users/2017-March/002837.html">https://lists.osgeo.org/pipermail/geonode-users/2017-March/002837.html</a> </div><div>[3] <a href="https://django-auth-ldap.readthedocs.io/en/latest/groups.html">https://django-auth-ldap.readthedocs.io/en/latest/groups.html</a><br></div><br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 25, 2018 at 7:18 PM, Francesco Bartoli <span dir="ltr"><<a href="mailto:xbartolone@gmail.com" target="_blank">xbartolone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div name="messageBodySection">Olivier,<br>
<br>
IMHO this approach is just an over engineering to achieve your use case.<br>
I would use an external common LDAP for that scope which is cleaner from an architectural point of view.<span class="HOEnZb"><font color="#888888"><br>
<br>
Francesco</font></span></div><div><div class="h5">
<div name="messageReplySection"><br>
Il 25 gen 2018, 04:34 +0100, Olivier Dalang <<a href="mailto:olivier.dalang@gmail.com" target="_blank">olivier.dalang@gmail.com</a>>, ha scritto:<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br>
<br></div>
We have very similar requirements here.<br>
<br></div>
I'm currently trying to set this up by sharing user tables between Geonode and Geoserver at database level rather than using OAuth2 calls.<br>
<br></div>
It works like this :<br>
<br></div>
1/ Create a JDBC <span>user/group service<br></span></div>
<div><span>2/ Create a authkey authentication using "user properties" (this works by reading a "UUID" property for each user)<br></span></div>
<span>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).</span></div>
<div><span>4/ Create a Django PasswordHasher so that Django and Geoserver's hashes are compatible<br></span></div>
<div><span><br></span></div>
<span>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, <span><span>you can add/edit users/groups from within Geoserver or Geonode.</span></span><br></span></div>
<div><span><br></span></div>
<div><span>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 <a href="https://lists.osgeo.org/pipermail/geonode-users/2018-January/004059.html" target="_blank">https://lists.osgeo.org/<wbr>pipermail/geonode-users/2018-<wbr>January/004059.html</a>). 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.</span></div>
<div><br>
<span></span></div>
<div><span>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...</span></div>
<div><span><br></span></div>
<div><span>Kind regards,</span></div>
<div><span><br></span></div>
<div><span>Olivier</span><span><br></span></div>
<div><span><br></span></div>
<span></span><span></span><br>
<div><span></span>
<div>
<div>
<div>
<div><br>
<br>
<br></div>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jan 23, 2018 at 9:02 AM, Pascal Coulon <span dir="ltr"><<a href="mailto:Pascal.Coulon@scisys.co.uk" target="_blank">Pascal.Coulon@scisys.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-GB">
<div class="m_-2748131880972513040m_6887074547297031224WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Brilliant – very useful – exactly what we are about to implement. If this works as per explained we will feedback here. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7a2b2e">Pascal Coulon <u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7a2b2e">GIS Technical Architect</span> <span style="color:blue"></span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7a2b2e">-</span> <span style="color:blue"></span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#7a2b2e">Enterprise Solutions & Defence</span><span style="color:blue"><br></span> <b><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#c72e2d">SCISYS UK Limited</span></b> <span style="color:blue"><br></span> <span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#343434">T: <a dir="ltr" href="tel:+44%20117%209165237" target="_blank">+44 (0)117 916</a></span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#343434"><a dir="ltr" href="tel:+44%20117%209165237" target="_blank">5237</a> | F: <a href="tel:+44%201249%20465237" value="+441249465237" target="_blank">+44 (0)1249 465237</a> | M:<a href="tel:+44%207876%20397844" value="+447876397844" target="_blank">+44 (0) 7876397844</a><br>
E:</span> <span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#343434" lang="FR"><a href="mailto:pascal.coulon@scisys.co.uk" target="_blank"><span lang="EN-GB">pascal.coulon@scisys.co.uk</span></a></span> <span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#343434">|</span> <span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#343434" lang="FR"><a href="http://www.scisys.co.uk/" target="_blank"><span lang="EN-GB">http://www.scisys.co.uk</span></a></span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b> <span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">Francesco Bartoli [mailto:<a href="mailto:xbartolone@gmail.com" target="_blank">xbartolone@gmail.com</a>]<br>
<b>Sent:</b> 22 January 2018 20:59<br>
<b>To:</b> Alessio Fabiani<br>
<b>Cc:</b> Pascal Coulon; <a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<b>Subject:</b> Re: [GeoNode-users] Geonode & Geoserver - Secure WMS<u></u><u></u></span></p>
</div>
</div>
<div>
<div class="m_-2748131880972513040h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Never tried this <a href="https://github.com/GeoNode/geonode/pull/3415" target="_blank">https://github.com/GeoNod<wbr>e/geonode/pull/3415</a> but it should allow to get an access token from external applications.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">@Pascal, it is worth a look and maybe a PR for geonode docs on how to use it.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Francesco <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Il giorno 22/gen/2018, alle ore 19:02, Alessio Fabiani <<a href="mailto:alessio.fabiani@geo-solutions.it" target="_blank">alessio.fabiani@geo-solutions<wbr>.it</a>> ha scritto:<u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<div>
<p class="MsoNormal">Hello Pascal,<u></u><u></u></p>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Regards,</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">Alessio Fabiani</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">==<br>
GeoServer Professional Services from the experts! Visit <a href="http://goo.gl/it488V" target="_blank">http://goo.gl/it488V</a> for more information.<br>
==<br>
<br>
Ing. Alessio Fabiani</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">@alfa7691<br>
Founder/Technical Lead</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif""><br>
GeoSolutions S.A.S.<br>
<a href="https://maps.google.com/?q=Via+di+Montramito+3/A+%0D+55054+%C2%A0Massarosa&entry=gmail&source=g">Via di Montramito 3/A</a><br>
55054 <a href="https://maps.google.com/?q=Via+di+Montramito+3/A+%0D+55054+%C2%A0Massarosa&entry=gmail&source=g">Massarosa</a> (LU)<br>
Italy<br>
phone: <a href="tel:+39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313</a><br>
fax: <a href="tel:+39%200584%20166%200272" value="+3905841660272" target="_blank">+39 0584 1660272</a><br>
mob: <a href="tel:+39%20331%20623%203686" value="+393316233686" target="_blank">+39 331 6233686</a><br>
<br>
<a href="http://www.geo-solutions.it/" target="_blank">http://www.geo-solutions.it</a><br>
<a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolution<wbr>s_it</a><br>
<br>
------------------------------<wbr>-------------------------</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">AVVERTENZE AI SENSI DEL D.Lgs. 196/2003</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">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.</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif"">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.</span><span style="font-size:9.5pt"><u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2018-01-22 18:50 GMT+01:00 Pascal Coulon <<a href="mailto:Pascal.Coulon@scisys.co.uk" target="_blank">Pascal.Coulon@scisys.co.uk</a>>:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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 <a href="http://mydomain/geoserver/geonode/wms" target="_blank">http://mydomain/geoserver/geon<wbr>ode/wms</a>, 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. <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Hope this makes sense. Any thoughts or pointer would be greatly appreciated.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Cheers,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Pascal<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Tahoma","sans-serif";color:blue"> </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:gray">SCISYS UK Limited. Registered in England and Wales No. <a dir="ltr" href="tel:4373530" target="_blank">4373530</a>.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:gray">Registered Office: Methuen Park, Chippenham, Wiltshire SN14 0GB, UK.</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span class="m_-2748131880972513040m_6887074547297031224m-3572463882427276572400184714-12042007"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:green">Before printing, </span></span><span class="m_-2748131880972513040m_6887074547297031224m-3572463882427276572296245114-12042007"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:green">please</span></span> <span class="m_-2748131880972513040m_6887074547297031224m-3572463882427276572400184714-12042007"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:green">think about the environment</span></span><span class="m_-2748131880972513040m_6887074547297031224m-3572463882427276572296245114-12042007"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:green">.</span></span><u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<br>
geonode-users mailing list<br>
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/geonode-users</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">______________________________<wbr>_________________<br>
geonode-users mailing list<br>
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/geonode-users</a><u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div class="m_-2748131880972513040h5">
<p class="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk" id="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk"></p>
<a id="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk" title="gfidisc.scisys.co.uk" href="http://gfidisc.scisys.co.uk" class="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk" style="text-decoration:none!important" target="_blank"></a><u></u>
<h1 class="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk"></h1>
<p><span style="color:#0000ff;font-family:Tahoma;font-size:small"> </span></p>
<div align="left"><span style="color:#808080;font-family:Arial;font-size:small">SCISYS UK Limited. Registered in England and Wales No. <a dir="ltr" href="tel:4373530" target="_blank">4373530</a>.</span></div>
<div align="left"><span style="color:#808080;font-family:Arial;font-size:small">Registered Office: Methuen Park, Chippenham, Wiltshire SN14 0GB, UK.</span></div>
<div align="left"> </div>
<div align="left"><span class="m_-2748131880972513040m_6887074547297031224400184714-12042007"><span style="color:#000000"><span style="font-size:7pt;font-family:Tahoma"><span style="font-size:xx-small"><span style="color:#008000"><span style="font-family:Arial">Before printing, <span class="m_-2748131880972513040m_6887074547297031224296245114-12042007">please</span> think about the environment<span class="m_-2748131880972513040m_6887074547297031224296245114-12042007">.</span></span></span></span></span></span></span></div>
<p class="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk" id="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk"></p>
<a id="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk" title="gfidisc.scisys.co.uk" href="http://gfidisc.scisys.co.uk" class="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk" style="text-decoration:none!important" target="_blank"></a><u></u>
<h1 class="m_-2748131880972513040m_6887074547297031224gfidisc.scisys.co.uk"></h1>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
geonode-users mailing list<br>
<a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/geonode-users</a><br>
<br></blockquote>
</div>
<br></div>
</blockquote>
</div>
</div></div></div>
</blockquote></div><br></div>