IdentityManager "Aborted Sign-In process..." with createMap in IE

4511
2
Jump to solution
11-27-2012 12:25 PM
JoanneMcGraw
Occasional Contributor III
Hello all,

I have a web map on ArcGIS Online that is only accessible by people within my group; a user must log in to see it. I also have an application that uses esri.arcgis.utils.createMap to add that web map to my HTML page and, of course, this required that I include the line "dojo.require("esri.IdentityManager");" to my script (which is the only thing I can see as necessary from the documentation).

In Firefox (I am using FF16), when I load my page, I am correctly prompted with the Login dialog as shown in the example https://servicesbeta.esri.com/demos/jsapi-samples/widget_identitymanager/index.html. In IE (I am using IE9), when I point to the above example it works fine, but when I try to load my page, the createMap functionality returns the error "Aborted the Sign-In process to avoid sending password over insecure connection" and does not create the map. The sample, in contrast, does not use createMap, but instead actually defines and creates the individual layers and adds them to the map itself.

In an attempt to make this easy to reproduce for anyone who cares to have a look, the following sample is the same as that found at http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/widget_mobilep... with the following changes:

1. I added a claro stylesheet and applied it to the BODY tag, so the Login Dialog would display with appropriate styling;
2. I added "dojo.require("esri.IdentityManager");"
3. I defined an "esri.config.defaults.io.proxyUrl" (which you will have to change, of course). Although this does not appear to be necessary in FF, it does seem necessary in IE...that's fine. It's in my application too.
4. I changed the web map id to point to mine rather than the one from the sample so the Login Dialog would appear (at least, in FF).

So, after changing the proxyUrl, you should be able to load this page in FF and get prompted with the LoginDialog. You will not get the  same result in IE. There, you won't see anything happen, but in the console during debugging you will see the error "Aborted the Sign-In process to avoid sending password over insecure connection".

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html>   <head>     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">     <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />     <!--The viewport meta tag is used to improve the presentation and behavior of the samples     on iOS devices-->     <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>     <title>Mobile Popup</title>     <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/esri/css/esri.css" />     <link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.2/js/dojo/dijit/themes/claro/claro.css" />  <style>       html, body { height: 100%; width: 100%; margin: 0; padding: 0; }       .esriScalebar{         padding: 20px 20px;       }       #map{         padding:0;       } </style>     <script type="text/javascript">var djConfig = {parseOnLoad: true};</script>     <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.2compact"></script> <script type="text/javascript"> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.require("esri.arcgis.utils"); dojo.require("esri.dijit.PopupMobile"); dojo.require("esri.IdentityManager");  var map,popup;  function init() {     esri.config.defaults.io.proxyUrl = "/EMAF/proxy/proxy.php";      //create a mobile popup     popup = new esri.dijit.PopupMobile(null, dojo.create("div"));      var mapDeferred = esri.arcgis.utils.createMap("3fc3f11514de4f9ab961dc9960d75388", "map", {                                                       mapOptions: {                                                           slider: true,                                                           nav:false,                                                           wrapAround180:true,                                                           infoWindow:popup                                                       }                                                   });     mapDeferred.addCallback(function(response) {                                 map = response.map;                                 //resize the map when the browser resizes                                 dojo.connect(dijit.byId('map'), 'resize', map,map.resize);                                  map.setExtent(new esri.geometry.Extent({"xmin":-52909106.87506947,"ymin":935889.3196982983,"xmax":-40483503.557034515,"ymax":7451993.106951275,"spatialReference":{"wkid":102100}}));                             });     mapDeferred.addErrback(function(error) {                                console.log("Map creation failed: ", dojo.toJson(error));                            }); } dojo.addOnLoad(init); </script>   </head>   <body class="claro">     <div dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%; margin: 0;">       <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="border:1px solid #000;padding:0;">       </div>     </div>   </body> </html>


Can someone let me know if there is something that I am missing in defining this? As far as I can tell from the documentation, the only thing necessary is that dojo.require line noted above, but perhaps there is some additional configuration settings necessary to work properly with IE that I missed.

Cheers,
jtm
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
The identity manager is used the app to capture your credentials and generate a token. To do this it needs to post to the token service using https in order to maintain a secure channel. Firefox and Chrome support CORS and when CORS support is available we can make this request via https. IE does not support CORS so it needs to use a proxy via https.  To make your app work in IE you???ll need to setup a proxy and an SSL certificate on the server that hosts the app and proxy.

View solution in original post

0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor
The identity manager is used the app to capture your credentials and generate a token. To do this it needs to post to the token service using https in order to maintain a secure channel. Firefox and Chrome support CORS and when CORS support is available we can make this request via https. IE does not support CORS so it needs to use a proxy via https.  To make your app work in IE you???ll need to setup a proxy and an SSL certificate on the server that hosts the app and proxy.
0 Kudos
JoanneMcGraw
Occasional Contributor III
Ah. Beautiful!

Thank you, Kelly, for:
1. Confirming what we have managed to determine over the last couple of days (that we can get the app to work in IE with an SSL certificate and proxy); and,
2. More interestingly to me, why this was not a problem in FF.

I have to admit, some of us were rather confused believing that somehow IE was more properly enforcing internet security policy than FF here. We should have known better...

Thank you again for taking the time to provide the information which, now that we are aware of it, is certainly discussed in the ESRI documentation. Although I'd read that section before, it's been a while and I forgot all about it.

Cheers,
jtm
0 Kudos