Search code examples
printinggeoservermapfish

Geoserver map printing with authentication


I am using the Mapfish Geoserver plugin for printing maps from Geoserver. It was working just fine.

For security reasons, I added an authentication plugin that needs an "authkey" parameter to access the layers. The problem is that I am not able to pass the parameters while printing the pdf. And I could not find any alternative method.

The example URL of the WFS layer with "authkey" is:

http://localhost:8080/geoserver/wms/reflect?format=application/openlayers&layers=store:layer&authkey=abcdefghij

And the URL for printing is:

http://localhost:8080/geoserver/pdf/print.pdf

Solution

  • I solved this issue by passing the parameter authkey in the print url.

    Something like this:

    http://localhost:8080/geoserver/pdf/print.pdf?authkey=abcdefghij