You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitHub Authentication: Support expiring GitHub tokens brokered through Microsoft Entra #335183
The GitHub Authentication extension can broker GitHub access tokens through a signed-in Microsoft Entra account. These exchanged GitHub tokens have a finite lifetime, but the extension previously treated them like ordinary persisted GitHub OAuth tokens with no known expiry or renewal path.
Once an exchanged token expired, consumers could lose authentication and fall back to an interactive sign-in prompt even though the Microsoft account was still signed in and could silently mint a replacement.
Desired behavior
Keep the exchanged token's absolute expiry internally.
Return its current relative lifetime through AuthenticationSession.expiresIn.
Recompute the remaining lifetime whenever a cached session is returned.
Silently renew Microsoft-brokered GitHub sessions before expiry, including the one-hour threshold required by the Copilot SDK.
Coalesce concurrent renewal attempts.
Retain a still-valid token when proactive renewal fails transiently, and only remove the session after the token actually expires.
Leave ordinary persisted GitHub OAuth sessions unchanged when their expiry is unknown.
Implementation
Implemented by #334418, including mocked coverage for initial exchange, restore, cached lifetime recomputation, renewal, and transient renewal failures.
You need a work machine where your Microsoft work account is signed in to the OS, and an account that has Continue with Microsoft (you probably do, see #339157).
Run code-insiders --transient and sign in with Continue with Microsoft.
Use Copilot in the Agents window so you know the sign-in works.
Leave that window open until the end of the day, or until the next day. Don't close it: a transient window starts over when it's closed, and restarting VS Code gets a fresh token anyway.
Come back and use Copilot again, both in an existing Agents session and a new one.
That's it. If you're never asked to sign in again and nothing fails with an auth error, it works. The token lives for about 6 hours, so by then it has been renewed at least once. To confirm, look for Renewed session in the GitHub Authentication output channel.
Activity
TylerLeonhardt commentedon Oct 1, 2026
Verification steps
You need a work machine where your Microsoft work account is signed in to the OS, and an account that has Continue with Microsoft (you probably do, see #339157).
code-insiders --transientand sign in with Continue with Microsoft.That's it. If you're never asked to sign in again and nothing fails with an auth error, it works. The token lives for about 6 hours, so by then it has been renewed at least once. To confirm, look for
Renewed sessionin the GitHub Authentication output channel.