Skip to content

fix(studio): refresh OAuth sessions transparently - #926

Merged
yaozheng-fang merged 1 commit into
volcengine:mainfrom
evanlowe:fix/studio-oauth-refresh-session
Aug 18, 2026
Merged

fix(studio): refresh OAuth sessions transparently#926
yaozheng-fang merged 1 commit into
volcengine:mainfrom
evanlowe:fix/studio-oauth-refresh-session

Conversation

@evanlowe

@evanlowe evanlowe commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep the OAuth refresh token in the signed HttpOnly browser session cookie so every Studio replica can restore the same session
  • automatically refresh expired or near-expiry access tokens for both protected APIs and /oauth2/userinfo, including refresh-token rotation
  • coalesce refreshes within one replica and retry short-lived cross-replica rotation races without exposing tokens to frontend JavaScript
  • derive the browser session ceiling from the VeIdentity client refresh-token lifetime
  • upgrade existing refresh-backed cookies on their next request, while leaving sessions without refresh tokens unchanged

Compatibility

Existing signed session cookies remain decodable. A legacy cookie containing a refresh token is immediately reissued with the configured absolute session expiry on its next authenticated request. Logout still clears the session, and an expired or revoked refresh token still requires authorization.

Verified both configured providers use refresh-token rotation with a 15-day idle lifetime and a 30-day combined lifetime.

Validation

  • 2065 Python tests passed, 6 skipped
  • 656 frontend tests passed
  • production frontend build passed
  • pre-commit passed: ruff check, ruff format, hardcoded-secret detection
  • focused OAuth/VeIdentity regression: 94 tests passed

@yaozheng-fang
yaozheng-fang merged commit f2cdf80 into volcengine:main Aug 18, 2026
7 checks passed
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.

2 participants