Esri / resource-proxy

Proxy files for DotNet, Java and PHP.
Apache License 2.0
371 stars 322 forks source link

Token Required with Login Prompt #289

Closed djg07 closed 9 years ago

djg07 commented 9 years ago

I've been attempting to set this up using the instructions in the Readme.md, but keep getting a "Token Required" error and subsequent login prompt when attempting to access the secured map service.

.config file looks like this:

<ProxyConfig mustMatch="false" allowedReferers="*">
<serverUrls>
      <serverUrl url="xxx/arcgis/rest/services/WebCom/Animal_Density_Bovine/MapServer" username="map1dev_user" password="xxx" matchAll="true"></serverUrl>
</serverUrls>
</ProxyConfig>

I tried getting a token from the rest interface and passing it in as "token='xxx'" but that didn't work either. Also, I am noticing I can't hit a breakpoint in proxy.aspx

esoekianto commented 9 years ago

@djg07 the proxy configuration file looks good to me. but the fact that passing the token didn't work is probably the key information here (assuming that we set the referer value correctly when generating the token)

Can you try different user maybe? It is probably easier if you can call esri tech support, we can help you debug this.

djg07 commented 9 years ago

@esoekianto

Just tried it with a different user with read privileges, same result.

I've been using "IP" as the Client when generating the token. Is this correct?

esoekianto commented 9 years ago

@djg07 thats okay.

The requests in your application are going thru the proxy right? You can try to also change the mustMatch property in proxy.config to true.

djg07 commented 9 years ago

Yup they are going through the proxy successfully.

djg07 commented 9 years ago

@esoekianto I updated to the most recent version of proxy.ashx . It is now working as expected.

2496772010 commented 5 years ago

I have the same problem.when i use the mapserver in html to open in web, it reminds me to login .