Populate TokenAcquisitionMetadata.ExpiresOn from AuthenticationResult#3904
Open
neha-bhargava wants to merge 4 commits into
Open
Populate TokenAcquisitionMetadata.ExpiresOn from AuthenticationResult#3904neha-bhargava wants to merge 4 commits into
neha-bhargava wants to merge 4 commits into
Conversation
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>
bgavrilMS
approved these changes
Jul 1, 2026
gladjohn
approved these changes
Jul 1, 2026
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>
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.
Summary
Populates
TokenAcquisitionMetadata.ExpiresOnfromAuthenticationResult.ExpiresOnin the metadata mapping, so callers of the metadata surface get the access token's absolute expiry on success.Changes
AcquireTokenResultFactory.MapMetadata: mapresult.ExpiresOn. Value is surfaced as part ofTokenAcquisitionMetadata, so it isnullwhen no metadata was captured (by design).DefaultAuthorizationHeaderProviderV2Tests.PropagatesMetadata.Related PRs
TokenAcquisitionMetadata.ExpiresOn).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.