Select to view content in your preferred language

Identity Manager

3440
3
Jump to solution
08-24-2015 07:28 AM
JeffreySchmidt
Deactivated User

Hi All,

I am having some trouble with the Identity manager.  In FF and Chrome things work great, but Internet Explorer is misbehaving... surprise surprise! The issue I am having is that the Identity Manager dialog to connect to secure services will only show up occasionally when the map loads. I have been checking the forums and some folks say I need to add https urls to my proxy config file.  Did that.  Still misbehaving... any other suggestions?  Is there are a way to build and initiate an identity manager on map load?  Simply adding in the right modules, i.e. (IdentityManager, esri/arcgis/utils, Dialog...) doesnt seem to do the trick like some of the docs mention.  The process is getting aborted occasionally as you see below in the image...  Any help would be very much appreciated!

2015-08-24_10-23-11.jpg

Thanks!

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Jeffery,

For many versions of IE (7,8,9) you'll need to run the entire app over https in order to avoid the 'Aborted the sign in process' error.

IE 7, 8 and 9 do not support CORS. So JSAPI cannot directly make request to the token service. It has to go through a proxy hosted on the same-origin as the application (identical protocol, hostname and port). So the app would communicate with proxy over HTTP and the proxy would communicate with the token service over HTTPS. This is okay for normal requests but not for requests that carry username and password. Hence the "Aborted" error message in IE.

You can force the app to reload over https only when the identity manager is needed by adding the following code to your app:

    esri.id.setProtocolErrorHandler(function() {
        console.log("protocol");
        if (window.confirm("Your browser is not CORS enabled. You need to redirect to HTTPS. Continue?")) {
          window.location = window.location.href.replace(/^http:/i, "https:");
        }
      });

View solution in original post

3 Replies
TracySchloss
Honored Contributor

I add a few more things into my project.  Besides IdentityManager, it works best for me to use "esri/urlUtils", and "esri/ServerInfo" as well.

var pathName = "myServer.mo.gov"  //the path to myserver.

      urlUtils.addProxyRule({

          urlPrefix: pathName

          proxyUrl: "../../proxy/proxy.ashx"  //this is the path to where my proxy config file is located

        });

      var serverInfo = new ServerInfo();

      serverInfo.server = pathName

      serverInfo.tokenServiceUrl = pathName+"/arcgis/tokens/generateToken";

Lastly, if you are trying to run this as localhost (http://127.0.0.1:8000) I've never had that work.  It only works for me when I have a fully qualified...

0 Kudos
JeffreySchmidt
Deactivated User

Thank you Tracy, I will try these ideas out!

0 Kudos
KellyHutchins
Esri Frequent Contributor

Jeffery,

For many versions of IE (7,8,9) you'll need to run the entire app over https in order to avoid the 'Aborted the sign in process' error.

IE 7, 8 and 9 do not support CORS. So JSAPI cannot directly make request to the token service. It has to go through a proxy hosted on the same-origin as the application (identical protocol, hostname and port). So the app would communicate with proxy over HTTP and the proxy would communicate with the token service over HTTPS. This is okay for normal requests but not for requests that carry username and password. Hence the "Aborted" error message in IE.

You can force the app to reload over https only when the identity manager is needed by adding the following code to your app:

    esri.id.setProtocolErrorHandler(function() {
        console.log("protocol");
        if (window.confirm("Your browser is not CORS enabled. You need to redirect to HTTPS. Continue?")) {
          window.location = window.location.href.replace(/^http:/i, "https:");
        }
      });