Skip to content

feat(auth): removed token refresh functionality - #3765

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
Sentiaus:auth-redesign
Sep 25, 2025
Merged

aglinxinyuan merged 3 commits into
apache:mainfrom
Sentiaus:auth-redesign

Conversation

@Sentiaus

Copy link
Copy Markdown
Contributor

Description


This PR mitigates the security issue described in #3737, by removing the token refresh functionality.

Problem


When user's sign in, they receive a new token. This token has a TTL of 2 days (2880 minutes), as defined by expiration-in-minutes in auth.conf. However, a user's token is refreshed if they make any action that creates a request to the backend, if the token has not already expired. The refresh time is the same as the original TTL, thus, a user could theoretically be signed in indefinitely. From a security perspective this is unsafe.

Solution


The token refresh functionality was removed from auth.service.ts. Additionally, since the refreshToken in auth.service.ts called the /refresh route from the backend, the route and any classes/functions it used were removed (AuthResource.scala, RefreshTokenRequest.scala). The TTL of the token was then changed to 7 days (10080 minutes) to improve user experience.

Side Effects


As noted in #3738, when a user's token is expired, but are not logged out, they are still able to access some data, but are unable to make any changes.
Because tokens are no longer refreshed, the user is more likely to encounter this case.

Fixes #3737

@chenlica

Copy link
Copy Markdown
Contributor

@Sentiaus Thanks for the PR. @jaeyun0503 Please take a look before other members review it.

@jaeyun0503

Copy link
Copy Markdown
Contributor

Thank you for the PR! I think the PR looks good. It is good for other members to review.

@aglinxinyuan aglinxinyuan left a comment •

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.

LGTM! We can remove the token refresh in this PR and decide whether to log the user out or display a message to the user in a separate issue (#3738).

@aglinxinyuan
aglinxinyuan merged commit f90848e into apache:main Sep 25, 2025
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
## Description
---
This PR mitigates the security issue described in apache#3737, by removing the
token refresh functionality.

## Problem
---
When user's sign in, they receive a new token. This token has a TTL of 2
days (2880 minutes), as defined by `expiration-in-minutes` in
`auth.conf`. However, a user's token is refreshed if they make any
action that creates a request to the backend, if the token has not
already expired. The refresh time is the same as the original TTL, thus,
a user could theoretically be signed in indefinitely. From a security
perspective this is unsafe.

## Solution
---
The token refresh functionality was removed from `auth.service.ts`.
Additionally, since the `refreshToken` in `auth.service.ts` called the
`/refresh` route from the backend, the route and any classes/functions
it used were removed (`AuthResource.scala`,
`RefreshTokenRequest.scala`). The TTL of the token was then changed to 7
days (10080 minutes) to improve user experience.

## Side Effects
---
As noted in apache#3738, when a user's token is expired, but are not logged
out, they are still able to access some data, but are unable to make any
changes.
Because tokens are no longer refreshed, the user is more likely to
encounter this case.

Fixes apache#3737
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
## Description
---
This PR mitigates the security issue described in apache#3737, by removing the
token refresh functionality.

## Problem
---
When user's sign in, they receive a new token. This token has a TTL of 2
days (2880 minutes), as defined by `expiration-in-minutes` in
`auth.conf`. However, a user's token is refreshed if they make any
action that creates a request to the backend, if the token has not
already expired. The refresh time is the same as the original TTL, thus,
a user could theoretically be signed in indefinitely. From a security
perspective this is unsafe.

## Solution
---
The token refresh functionality was removed from `auth.service.ts`.
Additionally, since the `refreshToken` in `auth.service.ts` called the
`/refresh` route from the backend, the route and any classes/functions
it used were removed (`AuthResource.scala`,
`RefreshTokenRequest.scala`). The TTL of the token was then changed to 7
days (10080 minutes) to improve user experience.

## Side Effects
---
As noted in apache#3738, when a user's token is expired, but are not logged
out, they are still able to access some data, but are unable to make any
changes.
Because tokens are no longer refreshed, the user is more likely to
encounter this case.

Fixes apache#3737
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Jul 31, 2026
…apache#7137)

### What changes were proposed in this PR?

Two GUI config flags were still defined and sent to the frontend but
read by nobody. `autoAttributeCorrectionEnabled` lost its consumer when
the schema auto-correct service was removed in apache#2578.
`expirationTimeInMinutes` lost its only reader when token refresh was
removed for security in apache#3765; the frontend now derives session expiry
from the JWT itself. This removes both across every layer they touched:
`gui.conf`, `GuiConfig` and its spec, the `/gui` config endpoint
(dropping the now-unused `AuthConfig` import), and the frontend
`GuiConfig` interface and mock. `AuthConfig.jwtExpirationMinutes` stays
untouched — `JwtAuth` still uses it to sign real tokens.

### Any related issues, documentation, discussions?

Closes apache#7135

### How was this PR tested?

Dead-code removal, grep-verified no remaining references to either flag.
Existing config specs (GuiConfigSpec, ConfigResourceSpec) continue to
cover the config surface.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 4.8)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

log users out periodically for security reasons

4 participants