Skip to content

Add IAuthorizationHeaderProvider2 with metadata-returning header-creation methods#257

Merged
bgavrilMS merged 1 commit into
mainfrom
nebharg/metadata-surface-poc
Jun 25, 2026
Merged

Add IAuthorizationHeaderProvider2 with metadata-returning header-creation methods#257
bgavrilMS merged 1 commit into
mainfrom
nebharg/metadata-surface-poc

Conversation

@neha-bhargava

@neha-bhargava neha-bhargava commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Adds IAuthorizationHeaderProvider2 : IAuthorizationHeaderProvider with a metadata-returning rich counterpart for each of the three base header-creation methods. Each returns OperationResult<AuthorizationHeaderInformation, AuthorizationHeaderError> (header value, binding certificate, and token-acquisition metadata) instead of a bare string:

Base method (IAuthorizationHeaderProvider) New rich method (IAuthorizationHeaderProvider2)
CreateAuthorizationHeaderForUserAsync CreateAuthorizationHeaderInformationForUserAsync
CreateAuthorizationHeaderForAppAsync CreateAuthorizationHeaderInformationForAppAsync
CreateAuthorizationHeaderAsync CreateAuthorizationHeaderInformationAsync

Each rich method takes the same input parameters (names, types, defaults) as the base method it mirrors — only the return type differs.

Why

The token-acquisition metadata surface (#253) added the rich POCOs (AuthorizationHeaderInformation with Metadata/BindingCertificate, AuthorizationHeaderError with Metadata/FailureDetails) and a DownstreamApiOptions-based rich provider (IBoundAuthorizationHeaderProvider). What remained was a rich (metadata-returning) counterpart for the scopes/string-based user, app, and unified entry points on the core provider. This interface fills that gap.

Design

  • Numeric-suffix interface evolution: extends the existing interface so a single implementation serves both; existing string-returning callers are unaffected (non-breaking, additive).
  • Signature parity: each ...InformationAsync method mirrors the inputs of its base ...Async counterpart exactly.
  • Result shape matches the existing IBoundAuthorizationHeaderProvider (OperationResult<AuthorizationHeaderInformation, AuthorizationHeaderError>).

Scope

New interface .cs + PublicAPI.Unshipped.txt entries across all 6 target frameworks. No behavioral code (pure abstraction), mirroring the footprint of #255. Build + public-API analyzer green.

…tion methods

Adds an additive numeric-suffix extension to IAuthorizationHeaderProvider that returns the
rich AuthorizationHeaderInformation (header value, binding certificate, and token-acquisition
metadata) as an OperationResult instead of a bare header string. Provides a rich counterpart
for each of the three base methods, each taking the SAME input parameters as its base method:

- CreateAuthorizationHeaderInformationForUserAsync  (mirrors CreateAuthorizationHeaderForUserAsync)
- CreateAuthorizationHeaderInformationForAppAsync   (mirrors CreateAuthorizationHeaderForAppAsync)
- CreateAuthorizationHeaderInformationAsync         (mirrors CreateAuthorizationHeaderAsync)

A single implementation can serve both interfaces and existing string-returning callers are
unaffected. Public API entries added across all target frameworks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@neha-bhargava neha-bhargava force-pushed the nebharg/metadata-surface-poc branch from 4514e8e to 0dfce51 Compare June 25, 2026 06:39
@neha-bhargava neha-bhargava changed the title Add IAuthorizationHeaderProvider2 with metadata-returning CreateAuthorizationHeaderInformationAsync Add IAuthorizationHeaderProvider2 with metadata-returning header-creation methods Jun 25, 2026
@bgavrilMS bgavrilMS merged commit 2a5e2e8 into main Jun 25, 2026
5 checks passed
@bgavrilMS bgavrilMS deleted the nebharg/metadata-surface-poc branch June 25, 2026 16:42
4gust added a commit that referenced this pull request Jun 29, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

2 participants