Make the authentication dialog timeout/reappear with period of inactivity

3163
4
12-24-2014 12:28 PM
EdwardSohn2
New Contributor III

Does the authentication dialog that appears for authentication timeout eventually with inactivity?  No mouse/keyboard activities?

If so, is it possible to control the time period of the inactivity to specify how long?

What happens when it times out?  For e.g. if the dialog reappears and user enters wrong credentials again, does it go to an error page?

0 Kudos
4 Replies
JoshHevenor
Occasional Contributor II

You can start a timer with window.timeout(function, 1000)  and it looks like you can get a reference to the window:

IdentityManager | API Reference | ArcGIS API for JavaScript

which is a

dijit/Dialog — The Dojo Toolkit - Reference Guide

Haven't tried this, but something like this should work:

// Listen for dialog and time it out, will want this setup before layers are loaded
esriKernel.id.on("dialog-create", function(){
     setTimeout(function(){
          kernel.id.dialog.hide();
     }, 30*1000) // 30 seconds
});
0 Kudos
EdwardSohn2
New Contributor III

The behavior I was seeing was the logon dialog appears out of the blue while working on the map.

I want to prevent this.  Was wondering perhaps there was a timeout value that was causing the dialog to reappear and if I can set this value to some max value. 

So either to 1) prevent the dialog from appearing or 2) tie this reappearance to some controlled process like period of inactivity rather than just timing out on its own.

0 Kudos
JoshHevenor
Occasional Contributor II

So you're logging in, working on the map for 61 minutes (enough to timeout the a default token) and your being prompted to log in again? 

0 Kudos
EdwardSohn2
New Contributor III

Yes.  The logon window just reappears (after initial logon) for some reason (whether it's timed out after 61 minutes or for some other).

And I believe if the user just clicks on Cancel it just disappears (this is what the user reported, though I haven't confirmed yet).

Would like to either prevent this behavior so it does not reappear and implement my own timeout logic and reloading the page, or control it somehow so that I can time it out according to a specified timeout value (and also prevent user from just clicking on the Cancel button once it reappears of course)...

Thanks.

0 Kudos