My project was switch the webmap from public to private and it's pop up the box to ask for login. How can I bypass the dialog box and use the username, password to authenticate inside my app? I know in swift application or objective C, we can use the portal credential to login automatically. But inside javascript there is no such setting, any help?
Solved! Go to Solution.
Weirong,
This is exactly what the Resource Proxy is designed for.
https://community.esri.com/groups/technical-support/blog/2015/04/07/setting-up-a-proxy
GitHub - Esri/resource-proxy: Proxy files for DotNet, Java and PHP.
Weirong,
This is exactly what the Resource Proxy is designed for.
https://community.esri.com/groups/technical-support/blog/2015/04/07/setting-up-a-proxy
GitHub - Esri/resource-proxy: Proxy files for DotNet, Java and PHP.
Is Resource Proxy is only for secure layer and features? Does the proxy support private webmap? I set up a nodejs version of the proxy server But it did not work.Any code example that can help me better understand the settings. Thank you.
Did the first like not help with that?
I'm sure the proxy can help resolve the issues, but right now I only have is the map ID, an usename and password. I testing it using Nodejs proxy resource code but it still pop up the login box. Dose Arcgis has some working example that might be very helpful. Thank you.
Weirong,
So you should know your orgs URL and the user name an password. That is all that is needed to configure the proxy.config file.
Here is an example:
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*" mustMatch="true" logFile="proxylog.txt">
<serverUrls>
<serverUrl url="https://www.arcgis.com" matchAll="true"/>
<serverUrl url="http://yourOrgName.maps.arcgis.com" matchAll="true" />
<serverUrl url="http://yourOrgName.maps.arcgis.com/sharing/rest" matchAll="true" username="x" password="******" />
</serverUrls>
</ProxyConfig>
And in the first link I provided follow step 12:
I follow exactly step by step and the login box still pop up. See the below for my details implementation, any suggestions for the settings? Thank you.
here is my config.json
and my javascript file to display the web map.
OK. I have re-read some of your replies and the Proxy that I am talking about and provided a link for does not have a Node version. You should download the Resource Proxy I gave a link to in my previous replies and then follow the instructions I provided already.
The information are very helpful, thank you. I generate the token use the link.
token format:
var token = {"server":"http://www.arcgis.com/share/rest","userId":"userId","token":"token str","expires":number,"ssl"::false}
call register token before create map
esriId.registerToken(token);