Problem printing WMS that uses windows authentication (JS 4.4)

935
2
08-11-2017 06:40 AM
ArneDahlman
New Contributor III

Hi all,

I need to consume an external WMS-service that uses windows authentication.

I have configured the Esri-resource-proxy with creedentials and I am able to add the service to the map. No problem.
But when I try to print the map using the print widget, it fails.

The problem is that print service does not receive the proxy-url inside the print request.
I think that if there are any proxy rules in the client, they should also be forwarded to the printservice.

Bug? Have I missed something? Is there an easier solution to this problem?


JS 4.4
resource-proxy 1.1.0


Thanks
Arne Dahlman

0 Kudos
2 Replies
SverkerNorlander
Esri Contributor

Hi Arne,

One option could be to use a modified version of the resource proxy:

https://github.com/sverkerEsriSE/resource-proxy-tokens 

There might also be other usable proxies, like Apache with some proxy module and a bit of rewriting the resource URL:s, or MapProxy perhaps.

We have used the proxy I linked to above with success when using it on some Swedish services with Http Basic Authentication (which is the reason it was modified).

Best regards,
Sverker

0 Kudos
ArneDahlman
New Contributor III

Hi Sverker,

Thanks for your response.

My main problem was that no proxy information was forwarded to the printservice.
I think this is a bug in JS4. Proxy information should be honored also when Printing.

In our previous Silverlight application we also had this problem. Here we could write the url like this to bypass the problem:
https://RESOURCEPROXYSERVER/esri-resource-proxy/proxy.ashx?http://maps.lantmateriet.se/topowebb/wms/...
In JS4 this trick is no longer working. The url gets chopped.

Our problem was solved in another way. We have the product F5, which is a lokal trafic manager.
With F5 it is possible to do som url-rewriting like you suggest in your answer.

The client points to F5 like it is a lokal network WMS-server (no proxy configuration in client).
In F5 the url is changed from:
https://F5SERVER/topowebb/wms/v1?SERVICE=WMS&REQUEST=GetCapabilities
to:
https://RESOURCEPROXYSERVER/esri-resource-proxy/proxy.ashx?http://maps.lantmateriet.se/topowebb/wms/...

The resource proxy is still needed for handelning the basic authentication.


Interesting fork you have made of the resurce-proxy.
I think it might solve som other issues we have. I'll definitely test it.


Best regards
Arne

0 Kudos