Hello,
I have tried all sorts of things before reaching out here, but I'm afraid I'm stuck. I need to consume a feature layer service from a third party ESRI Portal site. The service is secured using a Dynamic Token and I have been supplied a username and password to access the service. If I simply use a browser to get to the REST endpoint of the service I get prompted to login, which I can and I can see the layers in the service listed, so I know the login works.
My problem is I can't find a complete walk-through of how to do this for the JS API and I've been unable to piece together the information I've found. I'm using V3.28 of the API but I can change that if needed, and I'm using Version 1.1.2 of the Proxy pages, and my app is dot net V4.5. I'm familiar with the Proxy page and its use but not in the context of services with Dynamic Tokens.
So, in my JavaScript I add a proxy rule for where the service is:
esri.addProxyRule({
urlPrefix: "thedomain.co.uk",
proxyUrl: "proxy.ashx"
});
I think the problem then lies in the proxy config. I've found various suggestions online, so what I have below may contain things that aren't required, or are just wrong:
<serverUrl url="https://thedomain.co.uk"
tokenServiceUri="http://thedomain.co.uk/tokens/"
matchAll="true"
domain="thedomain.co.uk"
host="http://mydomain/"
dynamicToken="True"
username="portalUsername"
password="portalpassword"
></serverUrl>
No matter what I've tried, I keep getting prompted with a login box when I launch my API. What I'm trying to achieve is adding the feature service to my map without a login box appearing - I'm expecting the proxy details to handle that as all request to the service will be going through the proxy.
Am I missing something fundamental here? If I had a working example to see then I can usually work things out from it, but I just haven't been able to find one. Can anyone please point me to an end-to-end example or make suggestions here?
Thank you, Mark.