Posted on 11-03-2022 09:34 AM
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
Solved! Go to Solution.
Posted on 11-03-2022 12:37 PM
Hi @pbenware1 I created https://github.com/fveja/JSSCaffeinate for this reason! It works by keeping alive the web session.
Cheers,
Florin
Posted on 11-03-2022 12:37 PM
Hi @pbenware1 I created https://github.com/fveja/JSSCaffeinate for this reason! It works by keeping alive the web session.
Cheers,
Florin
Posted on 11-03-2022 06:27 PM
Sweet. TY, I will definitely give this a try.
Posted on 11-03-2022 06:51 PM
Great! Let me know how it works for you and what you think!
Posted on 07-26-2024 10:03 AM
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?
07-26-2024 11:46 AM - edited 07-26-2024 11:48 AM
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);
Posted on 07-26-2024 09:34 PM
What browser and what user-script plugin are you using?
Posted on 11-04-2022 06:49 AM
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.
Posted on 11-04-2022 07:21 AM
you can, if you move to dedicated instance.. $20k last time I looked.. 😱 (it does have some other 'stuff')
Posted on 11-04-2022 07:43 AM
@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.
Posted on 11-04-2022 08:41 AM
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!