Skip to content

Populate TokenAcquisitionMetadata.ExpiresOn from AuthenticationResult#3904

Open
neha-bhargava wants to merge 4 commits into
masterfrom
nebharg/3682127-surface-expireson
Open

Populate TokenAcquisitionMetadata.ExpiresOn from AuthenticationResult#3904
neha-bhargava wants to merge 4 commits into
masterfrom
nebharg/3682127-surface-expireson

Conversation

@neha-bhargava

Copy link
Copy Markdown
Contributor

Summary

Populates TokenAcquisitionMetadata.ExpiresOn from AuthenticationResult.ExpiresOn in the metadata mapping, so callers of the metadata surface get the access token's absolute expiry on success.

Changes

  • AcquireTokenResultFactory.MapMetadata: map result.ExpiresOn. Value is surfaced as part of TokenAcquisitionMetadata, so it is null when no metadata was captured (by design).
  • Tests: unit coverage for present/absent metadata + an end-to-end assertion in DefaultAuthorizationHeaderProviderV2Tests.PropagatesMetadata.

Related PRs

Merge note

This can be merged once the Abstractions package (12.4.0, with ExpiresOn) is released. CI will be red until then; the Abstractions version floor bump will follow that release.

Maps AuthenticationResult.ExpiresOn into the token-acquisition metadata
surface so callers get the access token's absolute expiry on success.
Adds unit coverage (present/absent metadata) and an end-to-end assertion
on the DefaultAuthorizationHeaderProvider metadata flow.

Requires Microsoft.Identity.Abstractions 12.4.0 (adds ExpiresOn).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Covers the top-level AcquireTokenResult.ExpiresOn mapping, complementing
the existing GetMetadata (metadata surface) and provider e2e coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
neha-bhargava and others added 2 commits July 1, 2026 11:26
master gained the ExpiresOn mapping independently; the merge left two identical
assignments in MapMetadata, causing CS1912. Drop the duplicate so the factory
matches master and this PR carries just the tests.

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.

3 participants