Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for web_idle_timeout #42058

Merged
merged 3 commits into from
Jun 3, 2024
Merged

Add docs for web_idle_timeout #42058

merged 3 commits into from
Jun 3, 2024

Conversation

ravicious
Copy link
Member

@ravicious ravicious commented May 27, 2024

Preview

We got a ticket from a customer who asked if it's possible to increase the timeout in Cloud.

It's not easy to figure this out since the idle timeout is not mentioned explicitly anywhere, other than in the config reference. And even if you find it there, then you need to know that that part of auth service config maps to cluster_networking_config in Cloud. On top of that, editing cluster_networking_config in Cloud clusters used to not work, but this has been fixed a while ago (#18829).

I added tabs for dynamic and static config which I copied from the Okta SSO guide. I know we want to remove them from how-to guides (#38931), but I think they're fine here? It feels important to show how it can be done in both environments. Let me know if I should replace the tabs with something else.

The docs are based on the relevant piece of code in the Web UI:

function startActivityChecker(ttl = 0) {
// adjustedTtl slightly improves accuracy of inactivity time.
// This will at most cause user to log out ACTIVITY_CHECKER_INTERVAL_MS early.
// NOTE: Because of browser js throttling on inactive tabs, expiry timeout may
// still be extended up to over a minute.
const adjustedTtl = ttl - ACTIVITY_CHECKER_INTERVAL_MS;
// See if there is inactive date already set in local storage.
// This is to check for idle timeout reached while app was closed
// ie. browser still openend but all app tabs closed.
if (isInactive(adjustedTtl)) {
logger.warn('inactive session');
session.logout();
return;
}
// Initialize or renew the storage before starting interval.
storageService.setLastActive(Date.now());
const intervalId = setInterval(() => {
if (isInactive(adjustedTtl)) {
logger.warn('inactive session');
session.logout();
}
}, ACTIVITY_CHECKER_INTERVAL_MS);
const throttled = throttle(() => {
storageService.setLastActive(Date.now());
}, ACTIVITY_EVENT_DELAY_MS);
events.forEach(event => window.addEventListener(event, throttled));
function stop() {
throttled.cancel();
clearInterval(intervalId);
events.forEach(event => window.removeEventListener(event, throttled));
}
return stop;
}

const events = [
// Fired from any keyboard key press.
'keydown',
// Fired when a pointer (cursor, pen/stylus, touch) changes coordinates.
// This also handles mouse scrolling. It's unlikely a user will keep their
// mouse still when scrolling.
'pointermove',
// Fired when a pointer (cursor, pen/stylus, touch) becomes active button
// states (ie: mouse clicks or pen/finger has physical contact with touch enabled screen).
'pointerdown',
];

Related issues:

Copy link

🤖 Vercel preview here: https://docs-p184ts3dm-goteleport.vercel.app/docs/ver/preview

Copy link

🤖 Vercel preview here: https://docs-3mzv1opjc-goteleport.vercel.app/docs/ver/preview

docs/pages/connect-your-client/web-ui.mdx Outdated Show resolved Hide resolved
`web_idle_timeout` setting.

<Tabs>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Connect your Client" docs are intended for end users instead of admins. Is it possible to rephrase the change to target end users? E.g., we could tell them to have an admin change web_idle_timeout.

Ideally, there would be a reference we could link to from here that explains the fields of cluster_networking_config for admins, but there doesn't seem to be one. I can open an issue so we can add this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Connect your Client" docs are intended for end users instead of admins. Is it possible to rephrase the change to target end users? E.g., we could tell them to have an admin change web_idle_timeout.

Ah, sure, I wasn't aware of that. AFAIK that's the only page dedicated to Web UI, so I didn't even consider putting this anywhere else. I'll adjust the copy a little bit.

Ideally, there would be a reference we could link to from here that explains the fields of cluster_networking_config for admins, but there doesn't seem to be one. I can open an issue so we can add this.

I'd appreciate that, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added: #42233
I've also approved the PR

Copy link

🤖 Vercel preview here: https://docs-fzb9jt87r-goteleport.vercel.app/docs/ver/preview

Merged via the queue into master with commit 18abae6 Jun 3, 2024
39 checks passed
@ravicious ravicious deleted the r7s/idle-timeout-docs branch June 3, 2024 09:05
@public-teleport-github-review-bot

@ravicious See the table below for backport results.

Branch Result
branch/v13 Failed
branch/v14 Failed
branch/v15 Failed
branch/v16 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants