Select to view content in your preferred language

tokens, proxy, secure services and the vanishing help

7526
14
Jump to solution
04-02-2014 04:56 AM
AdrianMarsden
Honored Contributor
Ok

I decided (why I don't know) to have yet another go at securing my services (about the tenth attempt I think)

First off, the help that was in the 9.x versions (http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/ve/help/Working with ArcGIS Server s...) seems to have vanished from the 10.2 help.  I cannot see any mention of "proxy.ashx" anywhere in the Help.

Secondly, I have a proxy page, it works, I can see the requests in Fiddler going via it.  However even though I have the token="jhkjghkjhkjhkjhkjhkjh" bit, it isn't passing this token.

Next, which leads me to believe it is all different in 10.2.1, despite the service being secured, and despite not seeing the token in Fiddler, and despite the logs saying it is using anonymous access, maps ARE displayed in my app.  It fails when I try an Id, find or query task.

I simply want a secure service and the API to pass the credentials, yet every time I try I end up bashing my head on brick walls.

Giving up for now

ACM
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
Adrian,

Are you using the new proxy files available on github?

https://github.com/Esri/resource-proxy

We have a .NET, Java and PHP version and each includes a read-me file with instructions for setup.

View solution in original post

0 Kudos
14 Replies
KellyHutchins
Esri Frequent Contributor
Adrian,

Are you using the new proxy files available on github?

https://github.com/Esri/resource-proxy

We have a .NET, Java and PHP version and each includes a read-me file with instructions for setup.
0 Kudos
AdrianMarsden
Honored Contributor
Cheers, I'll try that tomorrow. Any idea if the online help will be updated?
0 Kudos
KellyHutchins
Esri Frequent Contributor
0 Kudos
AdrianMarsden
Honored Contributor
Nope, sorry, still a fail on that with the new proxy pages.

I set it up and the page works.

My config is


<?xml version="1.0" encoding="utf-8" ?><ProxyConfig allowedReferers="*"
             mustMatch="false">
    <serverUrls>
        <serverUrl url="http://servername/ArcGIS/rest/services"
                   username="username"
                   password="password"
                   />
    </serverUrls>
</ProxyConfig>



Yet I get the login dialog when I start the webpage.

If I enter a valid username/password the map displays, but once again the ID tool fails - the client seems to get nothing back - nothing obvious in logs or error console.

Also, when I change the config to



<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="http://applicationRootURL/"
             mustMatch="true">


It fails with



w3wp.exe Error: 0 : 2014-04-04 10:40:54  Proxy is being used for an unsupported service (proxy.config has mustMatch="true"):

Only the false setting will work.

Am I alone in finding this all very confusing?

ACM

UPDATE #1

Changing to

<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="http://servername/"
             mustMatch="false">
    <serverUrls>
        <serverUrl url="http://servername/arcgis/rest/services/test/emap2/MapServer"
                   username="webmap"
                   password="password"
                   matchAll="true"/>
    </serverUrls>


- adding the full secured service URL and changing the matchall, seems to work - however I have several services I want to secure so adding just the root and matchall = false is the way I'd want to do it.
0 Kudos
KellyHutchins
Esri Frequent Contributor
Have you tried setting the root url and setting matchAll to true. Setting matchAll to true means that all requests that start with the url you provide will be forwarded to the proxy. Setting matchAll to false means the url has to match exactly.


        <serverUrl url="http://servername/ArcGIS/rest"
                   username="username"
                   password="password",
                   matchAll= "true"
                   />


0 Kudos
JohnGravois
Deactivated User
hi adrian,

did you download the code from our live repo or the 0.9 'official' released version?  if you downloaded the most up to date code, its possible the problem you are seeing is caused by a bug i introduced when modifying some internal logic when evaluating matches.

the live code today is a case sensitive match, so 'arcgis' in the proxy.config is not considered valid when the request is aimed at 'ArcGIS'.

we'll be fixing this very shortly.
https://github.com/Esri/resource-proxy/issues/77
0 Kudos
AdrianMarsden
Honored Contributor
Thanks for help. I got it working on internal sites ok yesterday. Still not happy where we publish via reverse proxy to the external site but you've given me pointers. I used the stable release, then the nightly.CheersAcm
0 Kudos
AdrianMarsden
Honored Contributor
Original reply marked as answered as that got most of the way there - many thanks - others marked as helpful!

For info - what is the lowest version of the API that the new proxy will work on?  I have some code stuck at 3.0, which onlyu seems to pass the initial requests in - query tasks go direct to server.

ACM
0 Kudos
AdrianMarsden
Honored Contributor
I spoke to soon - got in this morning and what was working on Friday isn't!  Again, the maps display fine, but fail to send anyhting back from ID tasks.
0 Kudos