DotNet Proxy - Random login prompts

6864
23
06-24-2016 12:03 PM
ChrisSmith7
Frequent Contributor


Hey guys, I am having a situation where the login prompt randomly shows when using v1.1.0 of the DotNet proxy against secured services (using login-based authentication).

I am unable to reproduce consistently - there's no rhyme or reason - and logging hasn't helped to tamp-down the culprit. I see others have encountered this as well:

Login prompt appearing randomly · Issue #300 · Esri/resource-proxy · GitHub

I had to many problems with login based authentication I just gave up. It seems to be extremely buggy and inconsistent.

Has anyone had any luck in resolving the issue? Bjorn Svensson​, do you have any recommendations for me to try, or maybe some caveats/known issues not indicated on GitHub? If I reload the page, the prompt will disappear and authenticate without having to manually enter credentials. Additionally, manually entering creds allows the app to continue functioning when the prompt displays. Really, it works the majority of the time, but... we need it to work 100% of the time!

A little bit about my set-up, if helpful:

* ArcGIS 10.3 on a Win 2k12 VM

* Web adaptor sourced on another Win 2k12 VM

* v1.1.0 of the DotNet API

* v3.16 of the JSAPI

* secured map service using login auth; xy event layer view from an MS SQL Server slice

* multiple maps embedded within iFrames on the host page; iFrames are hosted from the same server/project

* map service used as a FeatureLayer in the mapping app

Thanks!

0 Kudos
23 Replies
ArtemisFili
Esri Contributor

Chris, feel free to contact technical support and let them know that you are using the resource-proxy in the JavaScript API so that your question is routed to the right team.

ChrisSmith7
Frequent Contributor

Esri seems to think it's related to IIS/GIS server token timeout disconnects, so they are asked me to recycle the app pool one minute before the token expires. Instead, I am going to set the token timeout to one minute AFTER the recycle since I cannot make this change across all of our servers, but can adjust the ArcGIS server.

I am not entirely convinced this will resolve the issue - I'll try it, and create a test harness along the way to see if I can force it to reproduce under load.

0 Kudos
ChrisSmith7
Frequent Contributor

So, it doesn't seem to be an issue any longer! I'm going to mark this as "assumed answered."

RebeccaStrauch__GISP
MVP Emeritus

Chris, do you think this is what fixed it?

I am going to set the token timeout to one minute AFTER the recycle since I cannot make this change across all of our servers, but can adjust the ArcGIS server.

0 Kudos
ChrisSmith7
Frequent Contributor

It appears so - I haven't encountered the prompt since making the adjustment, and I haven't heard any issues from our users as of the moment.

When I chatted with Esri, they identified one similar case from their kb where this type of adjustment proved to be the resolution. I tried increasing the timeout before as you recommended, to 600 minutes... In hindsight, this ended-up not being enough since the token was still expiring before IIS recycled. Our recycle time in IIS is 1440 minutes, so bumped-up the token timeout on the GIS server to 1441, and problem solved! (I think...)

I'm not sure if we should mark this as the answer, or leave as assumed answered... It seems like a definitive resolution thus far, although perhaps a bit nebulous.

ChrisSmith7
Frequent Contributor

I reverted the "Assumed Answer" status. While the adjustment seems to have decreased the occurrences, we are still encountering the issue occasionally.

Esri support is recommending we try the following:

1. Can you please try to access the application by providing the token in the proxy instead of using username and password and see if the issue is still occurring?

I have been very busy of late and have had to put this on the back-burner. As soon as I have more notes, I'll add them here.

0 Kudos
MikeWynne
New Contributor II

I did exactly the same thing (changed the token timeout to 1441) and, unfortunately, the prompt still randomly appears.  I notice it a couple of times a week.

 

Mike

0 Kudos
ChrisSmith7
Frequent Contributor

Mike,

It ended-up not working out satisfactorily, but I really still haven't had a chance to look at it (and we haven't released the feature, yet).

If I can't get it resolved 100%, I have a kludge in mind... since we embed the maps as iframes in our product, and I've never had the prompt show up after a page reload, I was going to intercept the pop-up and reload the embedded map portion only.

The way we show this on the front end, the users would never know any difference. In the case where it does get into a reload loop, I'd stop after x number of reload attempts and allow the user to use the map (with this feature disabled).

Not ideal by any means - I'm also holding out hope that the next time I get back to this, a new proxy version will be available that resolves the issue.

0 Kudos
MikeWynne
New Contributor II

Thanks Chris.  That got me thinking and I implemented this messy option that seems to be working - I used some jQuery to repeatedly check for the div of the popup becoming visible within the first couple of seconds after the page loads. If it does appear the cancel button is programmatically "clicked" so it disappears immediately.

0 Kudos
ChrisSmith7
Frequent Contributor

Mike Wynne‌,

I ended-up implementing something similar... I have a global, empty JS object array created on a .NET masterpage, so it's available everywhere. When a page loads with embedded maps, I create a look-up of the map IDs and the number of reload attempts; if the map loads with the log-in pop-up, I attempt a reload of the affected, embedded map only... a max of three attempts, then I give-up and hide the dialog, which is actually never seen by the user the way my workaround is coded.

This is really a kludge for sure, and I feel like I need to take a shower, but it seems to be working flawlessly, and the user isn't any the wiser, so I think it's a win.

If I get a chance to figure out a better solution, or Esri updates the proxy and the issue resolves, I'll post back here.

0 Kudos