QGIS allows us to use any HTML in the map tip which can be used to show a corresponding image for a hovered feature in the map.
Example of such a code in the map tip definition:
<img src="http://imageserver.com/images/features/[% "id" %]" width="600"></img>
However, the server resource may require authentication. How to satisfy the server authentication requirement from the QGIS? How to supply the required credentials to be used in the image request?
Our server uses the basic authentication.
What I have tried:
Just let show the map tip in hope that QGIS prompts a login dialog. It did not happen.
I provided the authentication credentials in the "Options / Authentication" for the same base URL but it does not work. The QGIS seems to not respect the options.
I am still not getting the picture but just an error image placeholder:
I can clearly see from the server logs the requests are not authenticated and resulting in the 401 HTTP error.
EDIT 2 If you want to experiment, here is a simple Python script which is a HTTP web server with a basic authentication and hardcoded user "demouser" and password "demopass".
Start the script python .\imgsrv.py
. The server listens on http://localhost:8090/
and returns an image from the Pixabay.
Unfortunately, even this map tip in QGIS with this server does not work:
<img src="http://demouser:demopass@localhost:8090"></img>