Select to view content in your preferred language

password protected WMS-service

14155
14
02-22-2011 01:55 AM
ArneDahlman
Regular Contributor
We need to add a password protected WMS-service.
Any one know if this is possible?

I don't find anything on this in the API-documentation. Also, there is no 'Token' property in WmsLayer class.
0 Kudos
14 Replies
JenniferNery
Esri Regular Contributor
Yup that SLProxyPage. You can modify this item with your server URL and credentials you need to authenticate against.

    <serverItem url="http://net931/ArcGIS/rest/services"
                matchAll="true" domain="net931" username="rex" password="rex" />

Drop the ProxyPage folder to your C:\inetpub\wwwroot

In your IIS Manager, you can convert this folder to application and under IIS Authentication, disable Anonymous Authentication and enable either Basic or Windows Authentication.
0 Kudos
ArneDahlman
Regular Contributor
Thanks for your reply.

I think there might be some misunderstanding here.

I have a Silverlight application hosted on server A.
From this application I want to use a WMS-service hosted on server B. Server B is on the Internet.
I don't have access to server B, other than the user/password for this service.

I tried to deploy SLProxyPage on server A, with the settings you suggest.
When I run my application I get prompted for user/password  (here I used Basic Authentication in IIS-manager). The only user/password that seems to be accepted here, is one for server A. Then after a while I get a 500 response (using fiddler).
If I instead configure IIS to use Integrated Windows Authentication, I don't get prompted for user/password, but the result is the same (500 response).

So I think that this will only work if SLProxyPage is deployed on server B.
Can this be correct?
0 Kudos
ArneDahlman
Regular Contributor
OK, now I think I solved this.

I made some code changes in SLProxyPage.

There where three main problems:
1. Only working with ArcGIS server typeof URLs.
2. No support for internet proxy
3. Failed to download images with no content-length in response.

After I have completed the changes and run some tests. I'll add the modified SLProxyPage to this thread, in case some one is interested.
0 Kudos
JenniferNery
Esri Regular Contributor
That is good to know. I'm interested to see the updates you made to SLProxyPage too. 🙂
0 Kudos
ArneDahlman
Regular Contributor
Here is the code.

It's possible to configure internetproxy in proxy.config
If no proxy is configured default is used.

The url handling can be improved further, (Search for "url_401 = url.Substring(0, url.IndexOf("Server") + 6)")
0 Kudos