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.
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:
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.
Did you test your proxy page with the feature service url? Here are some examples on how to validate your proxy installation and configuration:
1 - Access your proxy page and validate the page without an url: https://<servername>/proxy.ashx?ping
2 - Test the proxy page with the feature service url: https://<servername>/proxy.ashx?<featureserviceurl>
3 - Enable the proxy log file to investigate the error message while trying to acess the feature service Use the ProxyConfig tag to specify property. logFile="proxylog.txt" : When a logFile is specified, the proxy will log messages to this file. N.B.: The folder containing the logFile must be writable by the web server.
Thanks for your reply. I know the proxy file works ok because I'm using it for credentials to access one of my own secured map services. When I test using https://<
Line 560: req.Referer = PROXY_REFERER; Line 561: writeRequestPostBody(req, bytes);Line 562: return req.GetResponse();Line 563: } Line 564:
I added the log file to <ProxyConfig as you suggested, but nothing gets written to it for the above error. I deliberately made my secured service error to make sure the log file was working ok and it is.