Hi, I'm trying to provide a simple authentication mechanism to my app through arcgis server. Basically what I'm after is this:
- User visits page
- App checks for local storage token (from previous sessions)
- App loads if the token is valid
- If token is not valid, identity manager pops up and user enters password and username
- identity manager gets a new token and the app is started.
- user leaves and just before, token gets saved to the local storage/cookie
So far I've been able to get the login dialog to display as expected, but once I click the sign in button, the message appears:
esri.config.defaults.io.proxyUrl is not set. If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers.
I have added the domain name 'gis.myserver.org' to the list of corsEnabledServers. The network request to authenticate is never sent. CORS is enabled on both the ArcGIS server, and the file server. I can see the headers in the network requests.
Access-Control-Allow-Headers:
DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
Access-Control-Allow-Methods:
GET, POST, OPTIONS
Access-Control-Allow-Origin:
*
Here's my sample code where I am stuck at:
authenticate: function() {
esriId.checkSignInStatus(this.url).then(
lang.hitch(this, 'onAuthenticate'),
lang.hitch(this, function() {
esriId.signIn(this.url, esriId.findServerInfo(this.url)).then(
lang.hitch(this, 'onAuthenticate'),
lang.hitch(this, 'onFail')
);
})
);
},
The error is thrown on the line of getProxyUrl in the urlUtils file. Since I added the url to the esriConfig though, I don't think the proxy should even be used. Do I need to configure a proxy regardless?