Override ArcGISTiledMapServiceLayer proxy authentication

3138
2
08-29-2011 06:59 AM
Labels (1)
MichaelCheng
New Contributor
We have a proxy, which when using ArgGIS Silverlight control, can talk to the server just fine.  However, when using the WPF control, it gets Authentication failed error.  Is there anyway to "plug" into the ArcGISTiledMapServiceLayer to manually set required values to pass our proxy server?
0 Kudos
2 Replies
MichaelCheng
New Contributor
Get this error when I set the ProxyUrl:

There was an error deserializing the object of type ESRI.ArcGIS.Client.Services.MapServiceInfo. Encountered unexpected character 'v'.
0 Kudos
JamesHatton
New Contributor
I wasn't sure where to post this because all the older threads are now set to archive so rather than posting a new thread I thought I should post in here for starters. The same should be applicable for your ArcGIS Runtime application to enable it to connect to WMS from behind a secured proxy. The following is a solution for ArcGIS Explorer that has had this bug since day dot.

This is going to be a bit of a lengthy post, so you may skip down to the solution part that edits a registry setting, but for the sake of learning do read ahead.

Previous solutions noted this:

1) the Authentication details directly unencrypted from the configuration file. Unfortunately I don�??t like the idea of multiple users connecting to a web map template and using my internet connection assigned to me.

2) Tell the configuration file to launch the proxy authentication service for the WMS layer. This seemed to me like it would work, however once the connection had been established where would the system �??store�?� the credentials that were passed in transaction to the proxy authenticator?

You may need administrator rights to enable this?

Some background info how I discovered this
1) I was requested for my credentials within ArcMap 10.0 everytime I clicked on the file menu. It was rather annoying for me and proved to be no help either providing it or not providing it details? I gathered that some �??allow�?� settings may have been given to the ArcMap further up the net connection allowed filter settings somewhere outside of my grasp? I was told to not worry about the annoying pop up to press cancel and everything will work anyway. I have since learned that their patch solution is not a very good one.

2) I use a Virtual Machine that I take home with me to do some work on at home. I noticed outside of the work web connection both ArcGIS Explorer and ArcMap naturally never requested credentials. This was no epiphany.

3) When I arrived at work and used the same VM with no settings changed in configuration; when I would open ArcMap it would request the Authentication Proxy log on because it was requested from a bridged connection.

4) Because the VM was being used regularly I found the Authentication Proxy popup quite annoying especially considering that feeding it the correct details did nothing. I recalled sometime ago how I managed to patch this for my VM so I dug the info up again. Essentially my Virtual machine only needs to request authentication once per session or when connection to new web enabled services. Hmm?

6) This patched solution I had enabled a while ago I decided to revisit again and do some comparative investigation at the registry level e.g

HKLM\SOFTWARE\Wow6432Node\ESRI\Desktop10.1\CoreRuntime

Here a new registry item was used to hold only internet settings such as authentication and pass to or use LibCurl http://curl.haxx.se/ a section bolded below.

curl is a command line tool for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks.

The registry setting added to support constant re-authentication issues is  "UseLibCurl"=dword:00000001
It does sound very scary. I don�??t care I like scary especially if it means making an app do as it was designed to do and no real means or mechanism to fix the darn thing in what�?�.ummm years since it has been raised as a bug. Anyway I digress you guys want the fix don�??t yas? 😉

7) I am not certain what versions that everyone else is using for ArcGIS explorer? But this should work for all versions with a bit of a tweak of the version number as well as a tweak of the version of the installed ArcGIS version that is being utilised if it is? If it is not please remove the locator reference. This works for ArcGIS Explorer build 1750

Open notepad and copy and paste the following. Save the file with a .reg extension

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ESRI\Explorer1750\CoreRuntime\Internet Settings]
"UseLibCurl"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ESRI\Explorer1750\CoreRuntime\Locator]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ESRI\Explorer1750\CoreRuntime\Locator\Settings]
"LocatorDirectory"="C:\\Program Files (x86)\\ArcGIS\\Desktop10.0\\Locators"
"GeocodeDirectory"="C:\\Program Files (x86)\\ArcGIS\\Desktop10.0\\Geocode"

😎 To reverse this you can either navigate the registry to the applicable keys via the path mentioned above and delete the Internet Settings and Locator settings nested under CoreRuntime under the Explorer registry. Or you can save a copy of the same thing above again only this time changing
[HKEY_LOCAL_MACHINE
to
[-HKEY_LOCAL_MACHINE
Just add a minus - sign at the front. Double clicking and re-registering with the reg file with the minus symbol removes these values from the registry.

9) All should be fixed now and you should be able to add a secured web service straight away without any need to reboot, but if you want to reboot cause that�??s your thing go right ahead �?

Note: There maybe other solutions that could utilise something like Windows inbuilt cryptography and SSL however I am not sure how to implement them at the moment? I will look into this for ESRI and if I find a solution that is more in �??sync�?� with an ESRI solution I will let them know reference for those interested ->  [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography\Configuration\SSL\00010002]


Testing this I realised that the secure proxy service was requested when I added the WMS service located outside of the organisation. This was not a secured service, specifically relating to secure services you will most likely need to provide your web access details to the proxy (this is the gateway details for you to access your organisations INTERnet not INTRAnet) then you maybe requested to provide another authentication for the web service it�??s self.

Something to note here, as per usual ArcGIS decides on occasions to open secondary instance or connection to the source so you may get a second authentication for a non-secure WMS, you will need to add it again. But chances are with the enabled solution libCurl should have retained your creditials for this session so just hit ok on the secondary authentication proxy popup dialog and you should be right to go.

If the first time that you are adding the service you are not prompted for your credentials when accessing a WMS then try to access the same WMS as a ArcGIS Server Service? For some reason that seemed to trigger the authentication proxy to pop up for me? God knows why? Anyway�?�don�??t try connect to it. Input your internet proxy credentials and then hit close the connection wizard for that service. Straight away click the drop down dialog and again choose WMS and this time it should produce the proxy dialog again and then it will connect.

Some additional notes:
Make sure that the web service that you are calling via open WMS has the full address for request. For example Department of Mines QLD Interactive Resources IRTM WMS has the following listed:

https://webgis.dme.qld.gov.au/webgiswms/com.esri.wms.Esrimap/IRTMWMS?

However I am able to obtain the connection faster by providing it a little more info like so

https://webgis.dme.qld.gov.au/webgiswms/com.esri.wms.Esrimap/IRTMWMS?request=GetCapabilities&service...

Something else that is worth noting here and I believe this is will be a new found bug with ArcGIS Explorer and I think this relates to a multi-threading issue already addressed in desktop or a internet security issue (although it doesn�??t occure in ArcMap �?? that being said my ArcMap has had filtering fiddled with up higher and beyond my level of access to security in job???)
Anyway try not to uncheck or check too many boxes in a short period let the service refresh to a stable before the next checkbox or it WILL CRASH so please be patient. This may have something to do with your proxy checking your packets??? Not much you can do about that other than make it less secure?

Enjoy ArcGIS Explorer within your organisation the way it was meant to be used  (as it was by design).


James
0 Kudos