Skip to content

Respect WebIdleTimeout in bearerTokenTTL#59645

Merged
avatus merged 1 commit intomasterfrom
avatus/bearer
Oct 9, 2025
Merged

Respect WebIdleTimeout in bearerTokenTTL#59645
avatus merged 1 commit intomasterfrom
avatus/bearer

Conversation

@avatus
Copy link
Copy Markdown
Contributor

@avatus avatus commented Sep 26, 2025

The webUI will log a user out due to invalid token if they haven't pinged the server within the idle time, which defaulted to the bearer token default (10 minutes). Instead, we should only default to 10 minutes if the web_idle_timeout is not configured in the cluster config. this aligns with how it is described in the documentation.
docs reference: https://goteleport.com/docs/connect-your-client/web-ui/

changelog: Fix the webUI timeout time to respect the cluster's WebIdleTimeout configuration.

edit: moving to draft. im doing to see if there is a different mechanism that we can leverage for the same effect, without increasing the bearer token expiry

Copy link
Copy Markdown
Contributor

@okraport okraport left a comment

Choose a reason for hiding this comment

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

I think the change makes sense but would like to get more eyes on this as I am unsure if this will have wider impact.

Comment thread lib/auth/sessions_test.go
webIdleTimeout: nil,
sessionTTL: time.Hour * 12,
expectedBearerTokenTTL: defaults.BearerTokenTTL,
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
},
{
name: "bearerTokenExpiry is sessionTTL when shorter than defaults.BearerTokenTTL",
webIdleTimeout: nil,
sessionTTL: time.Minute * 5,
expectedBearerTokenTTL: time.Minute * 5,
},

I don't actually know if this should be the behaviour based on the case above but we should make this codepath explicit.

Copy link
Copy Markdown
Contributor Author

@avatus avatus Oct 1, 2025

Choose a reason for hiding this comment

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

Good idea, thanks

@avatus avatus marked this pull request as ready for review October 1, 2025 16:34
@github-actions github-actions bot requested a review from okraport October 1, 2025 16:34
Copy link
Copy Markdown
Contributor

@rob-picard-teleport rob-picard-teleport left a comment

Choose a reason for hiding this comment

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

This makes sense to me, and implementation looks good. I'd still love to see the bearer token go away eventually of course, but this seems like a reasonable intermediate step!

@avatus
Copy link
Copy Markdown
Contributor Author

avatus commented Oct 8, 2025

friendly ping @kimlisa

This will probably just stay in master and not get backported, so we can see how it affects things

Copy link
Copy Markdown
Contributor

@okraport okraport left a comment

Choose a reason for hiding this comment

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

Having thought about it, I think this is good. Nice job.

Copy link
Copy Markdown
Contributor

@kimlisa kimlisa left a comment

Choose a reason for hiding this comment

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

:shipit:

The webUI will log a user out due to invalid token if they haven't
pinged the server within the idle time, which defaulted to the bearer
token default (10 minutes). Instead, we will only default to 10 minutes
if the web_idle_timeout is not configured in the cluster config
@avatus avatus added this pull request to the merge queue Oct 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 9, 2025
@avatus avatus added this pull request to the merge queue Oct 9, 2025
Merged via the queue into master with commit fa94bae Oct 9, 2025
40 checks passed
@avatus avatus deleted the avatus/bearer branch October 9, 2025 22:11
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@avatus See the table below for backport results.

Branch Result
branch/v16 Failed
branch/v17 Create PR
branch/v18 Create PR

@avatus
Copy link
Copy Markdown
Contributor Author

avatus commented Oct 9, 2025

I'll be holding off on backporting this. The plan is to release it next major but will come back to other backports if that changes.

avatus added a commit that referenced this pull request Nov 6, 2025
The webUI will log a user out due to invalid token if they haven't
pinged the server within the idle time, which defaulted to the bearer
token default (10 minutes). Instead, we will only default to 10 minutes
if the web_idle_timeout is not configured in the cluster config
rhammonds-teleport pushed a commit that referenced this pull request Nov 6, 2025
The webUI will log a user out due to invalid token if they haven't
pinged the server within the idle time, which defaulted to the bearer
token default (10 minutes). Instead, we will only default to 10 minutes
if the web_idle_timeout is not configured in the cluster config
github-merge-queue bot pushed a commit that referenced this pull request Nov 10, 2025
* Set MaxAge for cookie based on WebSession expiry (#58091)

* Set MaxAge in web cookie if time until expiry is > 0 (#58293)

This updates the logic to only setting max-age if the provided expiry is
in the future rather than any non-zero value.

* Respect WebIdleTimeout in bearerTokenTTL (#59645)

The webUI will log a user out due to invalid token if they haven't
pinged the server within the idle time, which defaulted to the bearer
token default (10 minutes). Instead, we will only default to 10 minutes
if the web_idle_timeout is not configured in the cluster config
mmcallister pushed a commit that referenced this pull request Nov 19, 2025
The webUI will log a user out due to invalid token if they haven't
pinged the server within the idle time, which defaulted to the bearer
token default (10 minutes). Instead, we will only default to 10 minutes
if the web_idle_timeout is not configured in the cluster config
mmcallister pushed a commit that referenced this pull request Nov 20, 2025
The webUI will log a user out due to invalid token if they haven't
pinged the server within the idle time, which defaulted to the bearer
token default (10 minutes). Instead, we will only default to 10 minutes
if the web_idle_timeout is not configured in the cluster config
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