Skip to content

Flow outgoing request to header providers via AcquireTokenOptions#3876

Merged
neha-bhargava merged 5 commits into
AzureAD:masterfrom
neha-bhargava:nebharg/outbound-shr-qhb
Jun 19, 2026
Merged

Flow outgoing request to header providers via AcquireTokenOptions#3876
neha-bhargava merged 5 commits into
AzureAD:masterfrom
neha-bhargava:nebharg/outbound-shr-qhb

Conversation

@neha-bhargava

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

Copy link
Copy Markdown
Contributor

What

Sets the materialized HttpRequestMessage on AcquireTokenOptions (via the Abstractions SetHttpRequestMessage extension) before CreateAuthorizationHeaderAsync, so request-aware providers can read it back.

Why

SignedHttpRequest (SHR / PoP) q/h/b binding claims must bind to the outgoing request. The call site already sets httpRequestMessage.Content before the auth header is created, so the request is available exactly where it's needed. Replaces the earlier IAuthorizationHeaderProvider2 interface check — behavior is unchanged for providers that don't read the value.

Depends on

@neha-bhargava neha-bhargava requested a review from a team as a code owner June 18, 2026 17:51
When the resolved IAuthorizationHeaderProvider implements IAuthorizationHeaderProvider2,
pass the materialized HttpRequestMessage so SignedHttpRequest h/b claims can bind to the
request body and headers. Falls back to the existing call when the provider is not
request-aware, so behavior is unchanged for existing providers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@neha-bhargava neha-bhargava force-pushed the nebharg/outbound-shr-qhb branch from 1794fbb to 379f886 Compare June 18, 2026 18:25
neha-bhargava and others added 2 commits June 19, 2026 11:39
Use the AcquireTokenOptions request helper to make the outgoing HttpRequestMessage
available to request-binding protocols (e.g. PoP SHR q/h/b) instead of the
IAuthorizationHeaderProvider2 interface. The helper clones ExtraParameters before
writing so concurrent calls never share this per-request value.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@neha-bhargava neha-bhargava changed the title Pass outgoing request to request-aware authorization header provider Flow outgoing request to header providers via AcquireTokenOptions Jun 19, 2026
@neha-bhargava neha-bhargava merged commit ca44998 into AzureAD:master Jun 19, 2026
4 checks passed
This was referenced Jun 24, 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.

3 participants