I configured a QGIS project as follows:
As you can see, QGIS Server is now serving two layers using WFS or WMS service. These two layers don't have the user/pass parameters saved in their layer configuration, so every time I open the project I am prompted to insert the user pass for the PostGIS connection (they are PostGIS layers):
Now we go to client (another computer) and I open a QGIS Client and I configure a new WFS connection introducing the user and password here (the user and password for the server to connect to PostGIS database):
I can see in the GetCapabilities request made by QGIS Client (captured using Fiddler proxy) that it is now adding authorization info in header:
If I try to connect to this new connection I get "there is no layer in service's capabilities".
I don't know if QGIS server is not binding the user/pass stored in HTTP's header to the QGIS project to connect the layers to PostGIS or what...
My goal is to be able to connect to QGIS Server using WMS/WFS services with different users and the server should connect to PostGIS with the user introduced in the client (this way I could in PostGIS know which user is connected, making changes, and control what each user can or can't do)