[GIS] ArcGIS Javascript API with Windows Authentication

arcgis-serverauthenticationjavascriptwindows

I am using the ArcGIS Javascript API to consume a feature layer on an ArcGIS Server secured with Windows Authentication. I want to satisfy the authentication programmatically so the web user isn't prompted with a login.

I've poked around the web and seen something about downloading an ASP.NET proxy page, but it is from the 9.3 section of the online ESRI resources. I'm just wondering if there is a different way to do it in 10.x versions?

Best Answer

A proxy page can also be used to bypass an authenticated service with 10.x versions of the APIs.

A few things to note:

  • Bypassing the Windows authentication with a proxy page will cause all of your connections to be made by the identity of the application pool that runs the proxy page, or by the identity of the connection you make within the proxy page. This may cause problems for tracking "who does what" since actions made through the proxy will all appear to be the same user.
  • Bypassing authentication may not be permitted by the publishing authority. Make sure you're allowed to publish the service in such a way before proceeding.
  • In the ESRI Javascript API, the proxy is set as a global setting, and all connections that would use a proxy will be directed through the same proxy page. So, if you're combining services in your map, make sure your proxy handler is ready to deal with whatever gets thrown at it approriately.

Windows Authentication is normally used on an internal network only, where you may take advantage of the integrated login, and bypass the login prompt that way. If your users are on the internal network, and have already logged on to the domain on their workstation, they shouldn't be challenged by a login prompt (IIS should already have handled that!)

Users that are not logged on to the network already, such as external users being directed to the Windows-secured server, will always be presented with a login prompt. There is no way to apply the login in the background once this prompt appears - its presence indicates that the background login attempt has already failed.