Add device code flow when not brokered#270453
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds device code flow authentication support when not brokered for the Microsoft Authentication extension. This provides an alternative authentication method for environments where traditional browser-based flows are not available or when broker authentication is not supported.
Key changes:
- Added device code flow as a new authentication method with support for different extension host environments
- Enhanced flow selection logic to consider client support and broker availability
- Integrated device code flow UI with clipboard integration and progress notifications
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
extensions/microsoft-authentication/src/node/flows.ts |
Adds DeviceCodeFlow class and updates flow selection logic to consider client support and broker availability |
extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts |
Implements device code authentication with user interaction and progress handling |
extensions/microsoft-authentication/src/node/authProvider.ts |
Updates authentication provider to determine client support and pass callback URI to flows |
extensions/microsoft-authentication/src/common/publicClientCache.ts |
Adds device code method to the cached client interface |
extensions/microsoft-authentication/src/common/loopbackClientAndOpener.ts |
Refactors to accept callback URI as constructor parameter instead of computing it |
extensions/microsoft-authentication/src/node/test/flows.test.ts |
Adds comprehensive test coverage for the new flow selection logic |
extensions/microsoft-authentication/src/common/test/loopbackClientAndOpener.test.ts |
Updates test to accommodate new constructor parameter and skips problematic test |
rzhao271
approved these changes
Oct 8, 2025
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.
fixes #270452