Enable IAuthenticationOperation2 to reject MSAL cached tokens and fetch new ones from ESTS - #5567
Merged
Bogdan Gavril (bgavrilMS) merged 7 commits intoNov 13, 2025
Conversation
Member
|
Not sure what the purpose for this is, but you cannot add a method to an itnerface. See #5376 |
Travis Walker (trwalke)
changed the base branch from
main
to
bogavril/formatResult
November 11, 2025 23:26
Travis Walker (trwalke)
marked this pull request as ready for review
November 12, 2025 10:39
| Task FormatResultAsync(AuthenticationResult authenticationResult, CancellationToken cancellationToken = default); | ||
|
|
||
| /// <summary> | ||
| /// Determines whether the cached token is still valid. |
There was a problem hiding this comment.
Suggested change
| /// Determines whether the cached token is still valid. | |
| /// Determines whether the cached token is still valid. Only works for client_credentials flow |
Bogdan Gavril (bgavrilMS)
approved these changes
Nov 12, 2025
Gladwin Johnson VR (gladjohn)
approved these changes
Nov 12, 2025
Co-authored-by: Gladwin Johnson <90415114+gladjohn@users.noreply.github.com>
Bogdan Gavril (bgavrilMS)
merged commit Nov 13, 2025
bff5d76
into
bogavril/formatResult
3 checks passed
Bogdan Gavril (bgavrilMS)
added a commit
that referenced
this pull request
Dec 16, 2025
…5376) * Fix for #5375 - Add a FormatResultAsync to IAuthenticationOperation * Fix * Some comments * fix * doc * Enable IAuthenticationOperation2 to reject MSAL cached tokens and fetch new ones from ESTS (#5567) * Initial prototype * Initial prototype * Refactoring * Reverting csproj changes * Apply suggestions from code review Co-authored-by: Gladwin Johnson <90415114+gladjohn@users.noreply.github.com> --------- Co-authored-by: trwalke <trwalke@microsoft.com> Co-authored-by: Bogdan Gavril <bogavril@microsoft.com> Co-authored-by: Gladwin Johnson <90415114+gladjohn@users.noreply.github.com> * Updating public API --------- Co-authored-by: trwalke <trwalke@microsoft.com> Co-authored-by: Travis Walker <travis.walker@microsoft.com> Co-authored-by: Gladwin Johnson <90415114+gladjohn@users.noreply.github.com>
This was referenced Jan 8, 2026
This was referenced Jun 5, 2026
Closed
Closed
This was referenced Jun 19, 2026
Closed
Closed
This was referenced Jun 29, 2026
Closed
This was referenced Jul 9, 2026
Closed
This was referenced Jul 16, 2026
Closed
This was referenced Aug 10, 2026
This was referenced Sep 17, 2026
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.
Fixes #
Changes proposed in this request
Adding
Task<bool> ValidateCachedTokenAsync(MsalCacheValidationData)toIAuthenticationOperation2This method will allow the implementation of IAuthenticationOperation2 (extensions) to validate if the cached token is still valid. If the token is not valid, this will tell MSAL to not use the token and to fetch a new one from ESTS. If the token is valid, MSAL will proceed as normal.
MsalCacheValidationDataprovides the data to the extension to enable it to determine if the token is valid.Testing
Unit tests
Performance impact
Documentation