feat: expose oauth discovery metadata source#1041
Open
DaleSeo wants to merge 1 commit into
Open
Conversation
DaleSeo
marked this pull request as ready for review
July 24, 2026 03:31
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.
Closes #1037
Motivation and Context
AuthorizationManager::discover_metadata()falls back to the legacy default endpoints,/authorize,/token, and/register, based on the base URL when discovery returns nothing. This fallback is required for theauth/2025-03-26-oauth-endpoint-fallbackconformance scenario. However, it makes a successful fallback look the same as metadata that the server actually published. As a result, callers that use discovery to determine whether a server supports OAuth can no longer receive aNoAuthorizationSupport-style signal. That behavior was originally introduced in #507 and changed by #960.This implements Option A from the issue: a new
discover_metadata_with_source()method returns the metadata together with anAuthorizationMetadataSource, plus anis_discovered()helper.discover_metadata()now delegates to it and its docs point callers that need capability detection to the new method. Existing behavior and the conformance scenario are untouched.How Has This Been Tested?
Unit tests cover all three sources
Breaking Changes
None
Types of changes
Checklist