Skip to content

FEAT: Add browser-session authentication for M365 Copilot - #2514

Open
Adrian Gavrila (adrian-gavrila) wants to merge 4 commits into
microsoft:mainfrom
adrian-gavrila:adrian-gavrila-design-m365-copilot-target
Open

FEAT: Add browser-session authentication for M365 Copilot#2514
Adrian Gavrila (adrian-gavrila) wants to merge 4 commits into
microsoft:mainfrom
adrian-gavrila:adrian-gavrila-design-m365-copilot-target

Conversation

@adrian-gavrila

Copy link
Copy Markdown
Contributor

Description

Adds interactive browser-session authentication for the M365 Copilot WebSocket target.

The new BrowserSessionCopilotAuthenticator:

  • Uses a persistent Microsoft Edge profile for user-driven authentication.
  • Supports MFA, Conditional Access, passwordless authentication, and account selection.
  • Captures Copilot tokens without storing user credentials.
  • Keeps tokens in memory and refreshes them on use near expiry.
  • Retains a minimized browser session for automatic token recapture.
  • Supports standalone scripts and Windows Jupyter notebooks.
  • Isolates personas through separate browser profile paths.
  • Preserves the existing automated-credential and manual-token authenticators.

This also updates the default M365 Copilot ChatHub endpoint to substrate.svc.cloud.microsoft while leaving the separate image-upload endpoint unchanged.

Related work: ADO #12409 and ADO #12568.

The M365 Copilot WebSocket protocol remains undocumented and may change.

Tests and Documentation

  • Added unit coverage for token validation, expiry handling, concurrent capture, cancellation cleanup, browser lifecycle, URL filtering, persona isolation, and event-loop ownership.
  • Existing Copilot authenticator and WebSocket target tests pass.
  • Ruff, ty, and repository pre-commit checks pass.
  • Live-tested text, multi-turn, parallel, image, standalone browser-session, Jupyter, and explicit token-recapture flows.
  • Added an executable browser-session authentication example to the paired Jupytext documentation.
  • Jupytext strict synchronization passes.
  • Natural near-expiry renewal soak test is pending.

@adrian-gavrila
Adrian Gavrila (adrian-gavrila) marked this pull request as ready for review August 28, 2026 20:05
@adrian-gavrila Adrian Gavrila (adrian-gavrila) changed the title [DRAFT] FEAT: Add browser-session authentication for M365 Copilot FEAT: Add browser-session authentication for M365 Copilot Aug 28, 2026
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.

1 participant