Skip to content

Respond promptly to Microsoft account sign-out for open Entra connections #1119

Open

Description

Problem

Signing out of Microsoft in VS Code does not necessarily stop an established DocumentDB connection. The driver can authenticate new sockets with an already-issued access token that the server still accepts. VS Code sign-out does not revoke that token at the server.

This is a follow-up to #1102, outside the 1.2.0 connection-lifecycle scope. It is not a prerequisite for the existing sign-out recovery test. See decision 0012.

What to validate

  • Treat a VS Code session-change event as a signal to recheck, not proof of sign-out. The event names the provider only. Recheck the affected connections' pinned provider, account, and tenant silently. A lookup error, routine refresh, unrelated account change, or stale result must not close a connection.
  • If the pinned session is gone, stop reusing the affected database client and pool. The driver has no public API to evict only its OIDC token. Preserve connection settings and open work; offer explicit Sign in again, with no unsolicited prompt. Do not remove VS Code sessions or claim server-side revocation.
  • Define behavior for active import, export, and copy tasks before changing teardown. Avoid interrupting running work by default. Include Shell and Playground connections, which have separate clients, so the resulting behavior is consistent or its limits are documented.
  • Cover two accounts on the same provider, sovereign-cloud provider changes, stale checks racing sign-in or reconnect, an active task, and worker behavior.

Activity

  1. tnaum-ms commented on Nov 24, 2026

    @tnaum-ms
    CollaboratorAuthor

    Related low-severity case from PR4 review: if a closed Entra client is replaced and the pinned VS Code session is missing, a later foreground action can make another silent lookup. Preserve the current behavior for 1.2.0: signing in through VS Code Accounts can make that silent lookup succeed without forcing another prompt. Revisit this case as part of prompt sign-out handling, without treating a routine session refresh or another account’s event as sign-out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions