Add SPS endpoint allowlist and secure probe client#672
Merged
Conversation
embetten
commented
Apr 27, 2026
cobya
approved these changes
Apr 28, 2026
…oint - Add exact host 'vssps.codedev.ms' to AllowedSpsHosts so codedev PPE feeds can successfully exchange bearer tokens for session tokens - Replace silent null return on untrusted SPS endpoint with an UntrustedSpsEndpointException so the credential provider exits immediately instead of falling through to device-code polling - Add unit test for fail-fast behavior when SPS endpoint is untrusted - Add unit test coverage for vssps.codedev.ms allowlist entry
…with dev.azure.com
cobya
reviewed
Apr 30, 2026
cobya
approved these changes
Apr 30, 2026
cobya
approved these changes
Apr 30, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR tightens how the credential provider handles discovery and token exchange as part of ongoing Entra identity hardening:
Credentialless probe client: Introduced HttpClientFactory.Probe, a dedicated HttpClient for discovery requests that does not set UseDefaultCredentials. This ensures Windows Integrated Authentication credentials are not sent when probing unknown endpoints for Azure DevOps headers.
HTTPS-only probing: Unknown hosts are now only probed over HTTPS. HTTP endpoints that aren't in the known hosts list are immediately treated as external without making a network call.
SPS endpoint allowlist: Added validation of the X-VSS-AuthorizationEndpoint header value before exchanging bearer tokens. The endpoint must match a known Azure DevOps SPS hostname (e.g., *.vssps.visualstudio.com, vssps.dev.azure.com). This prevents session token exchange against unexpected endpoints.
Testing:
258 unit tests passing (including 19 new tests for SPS allowlist validation)
Integration tested against a live Azure DevOps feed across all three target frameworks (net481, net6.0, net8.0) with broker, no-broker, and Entra token opt-in configurations