biigle / geo

:m: BIIGLE module to explore images on a world map
GNU General Public License v3.0
0 stars 1 forks source link

Support password protected WMS #62

Open mtiessen1175 opened 2 months ago

mtiessen1175 commented 2 months ago

Web map services that require authentication (username & password) are not yet supported in the geo-overlay upload. This would be highly desired according to an expert user.

Possible steps:

mzur commented 2 months ago

I'd recommend to store the credentials when the WMS layer is created (on the volume edit page) and then store them encrypted in the WMS JSON column. Then the layer can be used by all users who have access to the volume.

mtiessen1175 commented 2 months ago

@tschoeni, I used the PHP file_get_contents() function to access the WMS here. It should be possible to provide authentication parameters via the $context parameter (see here). What I would have to do in the getCapabilities() method is to somehow catch the XML exception (LayerNotDefined which you showed me earlier). This should trigger an authentication dialog for the user to provide the access-credentials (and store them as @mzur suggested above).

mzur commented 2 months ago

You can also always allow the user to enter credentials when they create a new layer. If the WMS requires authentication but the user didn't enter credentials, loading can just fail with a helpful error message. The user will figure it out.