jeremy.wiebe

Sending token(s) to Non-ArcGIS WMS services

Discussion created by jeremy.wiebe on Nov 1, 2012
Latest reply on Jan 14, 2013 by jonase
Hi all,

We are using the ArcGIS v3.2 Javascript API.  Most of our mapping is done by ArcGIS, but we have a swappable base layer that we allow the user to change (aerial and satellite imagery or topography).  We are doing this using an esri.layers.WMSLayer().

The service that is supplying this imagery is proxied through a mapproxy (http://mapproxy.org/) server.  Some of these proxied layers we have to pay for per-request and require a user token with each request.  

I've been looking at the IdentityManager and IdentityManagerBase classes but from what I've read they're only applicable if you are using a secured ArcGIS server. 

Does anyone have any ideas on how this might be done?   I've tried embedding the tokens in the url when creating the WMSLayer but those are stripped when the javascript API starts calling out to the service.  Well, to be clear, the token remains in the first call to our proxy page (esri.config.defaults.io.proxyUrl) but is then gone when the API makes a direct call to the mapproxy service. 

The request to the proxy page looks like this (I've removed the actual IP):

http://localhost:47689/Map/Proxy.ashx?http://1.1.1.1/mapproxy/service?token=zzzzz&SERVICE=WMS&REQUEST=GetCapabilities

Then the API goes directly to the proxied page:

http://1.1.1.1/mapproxy/service?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=&VERSION=1.1.1&LAYERS=topo&WIDTH=1584&HEIGHT=563&SRS=EPSG:900913&BBOX=-16818853.95026643,6075910,-9862030.049733568,8548569

Outcomes