Repository navigation
authentication: Express token expiry in milliseconds - #335610
Merged
Merged
Conversation
Rename the token exchange duration to expiresAfter and convert OAuth seconds at the exchange boundary. Co-authored-by: Copilot <[email protected]>
Expose MSAL's token expiration through the proposed authentication session expiration API as a positive millisecond duration. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The unit conversions, cached-session recomputation, protocol compatibility, and associated tests are internally consistent.
Review tier: Balanced
Findings: None
What changed in this PR
Updates authentication-session expiry semantics to use relative milliseconds while preserving the Agent Host protocol’s seconds-based contract.
Changes:
- Renames
expiresIntoexpiresAfterand documents milliseconds. - Converts and recomputes GitHub and Microsoft token lifetimes.
- Converts milliseconds back to seconds at the Agent Host bridge and updates tests.
| File | Description |
|---|---|
src/vscode-dts/vscode.proposed.authSessionExpiration.d.ts |
Updates the proposed API contract. |
src/vs/workbench/services/authentication/common/authentication.ts |
Updates the internal session model. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.ts |
Converts milliseconds to protocol seconds. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostAuth.test.ts |
Updates bridge conversion tests. |
extensions/microsoft-authentication/package.json |
Enables the expiry proposal. |
extensions/microsoft-authentication/tsconfig.json |
Includes the proposal declaration. |
extensions/microsoft-authentication/src/node/authProvider.ts |
Exposes MSAL token lifetime. |
extensions/github-authentication/src/github.ts |
Stores and recomputes millisecond lifetimes. |
extensions/github-authentication/src/entraTokenExchange.ts |
Converts OAuth expiry seconds to milliseconds. |
extensions/github-authentication/src/test/github.test.ts |
Updates provider lifetime tests. |
extensions/github-authentication/src/test/entraTokenExchange.test.ts |
Updates exchange expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TylerLeonhardt
marked this pull request as ready for review
September 11, 2026 01:46
TylerLeonhardt
enabled auto-merge (squash)
September 11, 2026 01:46
Christof Marti (chrmarti)
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
expiresIntoexpiresAfterand define it as millisecondsexpires_invalues at the provider boundary and recompute remaining lifetimes for cached transient sessionsexpiresInfield by converting at the workbench bridgeCloses #335184.
Related to #152517.
Testing
npm --prefix extensions\github-authentication run compilenpm --prefix extensions\microsoft-authentication run compileexpiresOnbecomes a positive integer millisecondAuthenticationSession.expiresAftervalue and flows through the returned sessiongit diff --check origin/main...HEADA full
npm run compilereached the changed extensions successfully but is currently blocked by unrelated markdown editor type errors involvingIframeEmbeddedEditorHostTransportandiframeBootstrapUrl.