Jamf Cloud web session timeout change?

pbenware1
Release Candidate Programs Tester

Hey All,

Is it possible to change the timeout on a Jamf Cloud console session?

We're on Jamf Cloud 10.42 using SSO to login to the console, if that matters.

The main issue (among others), is that when performing a GSX lookup, the web session usually times out before the look up finishes.

We have ~1400 workstations which takes at least 10-15 minutes to update, but more often than not results in a session timeout.  

I've tried creating a SMART group where there is no Warranty info for the device, but the only options are Warranty Expiration is before/after or within a certain # of days.

It does seem as though if I open a new JSS tab in the same browser window and work in there while the GSX lookup is ongoing in the other tab, that the GSX lookup session will not timeout.

I did check the SSO settings, but it only has a Token expiration time, which is not what I'm looking for.

 

Thanks for any thoughts.

Phil

1 ACCEPTED SOLUTION

Fveja
New Contributor III

Hi @pbenware1 I created https://github.com/fveja/JSSCaffeinate for this reason!  It works by keeping alive the web session.

Cheers,

Florin

View solution in original post

10 REPLIES 10

Fveja
New Contributor III

Hi @pbenware1 I created https://github.com/fveja/JSSCaffeinate for this reason!  It works by keeping alive the web session.

Cheers,

Florin

pbenware1
Release Candidate Programs Tester

Sweet.  TY, I will definitely give this a try.

Fveja
New Contributor III

Great!  Let me know how it works for you and what you think!

jakeah18
New Contributor III

It's not working for me. Here's what I got when I try to run it:

./caffeinate.js: line 1: //: is a directory

./caffeinate.js: line 2: //: is a directory

./caffeinate.js: line 3: //: is a directory

./caffeinate.js: line 4: //: is a directory

./caffeinate.js: line 5: //: is a directory

./caffeinate.js: line 6: //: is a directory

./caffeinate.js: line 7: //: is a directory

./caffeinate.js: line 8: //: is a directory

./caffeinate.js: line 9: //: is a directory

./caffeinate.js: line 11: syntax error near unexpected token `'Started JSS Caffeinate. Running on ''

./caffeinate.js: line 11: `console.log('Started JSS Caffeinate. Running on ' + location.href)'

 

Maybe I am doing something wrong. Any advice?

jamf-42
Valued Contributor II

can't remember who made the JS.. but use Arc Browser.. setup a Boost and add this JS.. it works..

 

EDIT: oh it's the same code! Use Arc boost.. 😎

 

// ==UserScript==
//         JSS Caffeinate
// @version     0.3
// @description Simulates mousedown events every few minutes, to activate keepalive call of JSS
// @match       https://<yourJssUrlWithoutPort>/*
// @updateURL   https://github.com/fveja/JSSCaffeinate/raw/main/JSS%20Caffeinate.js
// @noframes
// Florin Veja 2022
// ==/UserScript==

console.log('Started JSS Caffeinate. Running on ' + location.href)

// delay, in milliseconds, before we send mousedown event (120000 milliseconds = 2 min)
const delay = 120000
var last = Date.now()
const name = "JSS Caffeinate"

// set to true for debug console output
const jssCaffeinateDebug = false

// function to send us back to the 
const login = () => {
  debug("logging in")
  location = location.origin
}

const debug = (m) => {  
  typeof jssCaffeinateDebug == 'boolean' &&
      jssCaffeinateDebug &&
      console.log(name + " debug: " + m)
}

const authExpiration = () => { 
  return JSON.parse(localStorage.authToken).expires - Date.now()
}

const getDelay = (max) => {
  const min = 10000
  return Math.random() * (max - min) + min
}

// if we are on the logout page, log back in
// randomize to not create a race 
if (location.pathname == '/logout.html') {
  setTimeout(login(), getDelay(10000))
}

const café = setInterval(() => {
             var start = Date.now()
             const mousedown = new Event('mousedown')
             debug('JSS Caffeinate keepalive ' + start)
             document.dispatchEvent(mousedown)
             debug("authToken expires in " + authExpiration())
             debug(last + " - " + start + "=" + (start - last))
             last = start
             if (authExpiration() < 1) { login() }
           }, delay);

 

 

Fveja
New Contributor III

What browser and what user-script plugin are you using?

pbenware1
Release Candidate Programs Tester

Worked for me.  Ran my GSX update with 0 timeouts.

But it does beg the question of why this can't be made longer or user configurable.

jamf-42
Valued Contributor II

you can, if you move to dedicated instance..  $20k last time I looked.. 😱 (it does have some other 'stuff')

pbenware1
Release Candidate Programs Tester

@jamf-42 Thanks for that.  I found the PDF for the Premium Cloud service.  Best guess is my org won't spring another $20K just to stop my complaining about timeouts, even with the other features.

jamf-42
Valued Contributor II

yea.. tuff one.. "but it will save 10mins a day!!" 🤣  was simple to do when on prem.. it should at least be an option (like you know every other admin panel!)  at least we have a new design on the config page!