Ensure Assertions are used during Token Refreshes#293
Merged
pgermishuys merged 1 commit intomainfrom Nov 11, 2025
Merged
Conversation
a7dc1dd to
52980e5
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where the OpenIdConnectUserAccessTokenRetriever was not properly setting the Assertion field during token refresh operations. The fix ensures that assertions are correctly propagated both from the initial parameters and after customization.
- Added missing
Assertionassignment from base parameters - Added missing assignments for
Assertion,Parameters, andForceTokenRenewalafter customization - Added comprehensive test coverage for token request customization and assertion propagation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| OpenIdConnectUserAccessTokenRetriever.cs | Fixed missing Assertion assignment from base parameters and added missing field assignments after customization |
| TokenRetrieverTests.cs | Added new unit tests to verify that customizers can properly modify token request parameters including assertions |
| TokenRequestCustomizerIntegrationTests.cs | Added integration test to verify assertion propagation during token refresh and updated existing test helpers to support assertion testing |
| IdentityServerHost.cs | Added token request capture capability to enable verification of assertion values in integration tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...nt/src/AccessTokenManagement.OpenIdConnect/Internal/OpenIdConnectUserAccessTokenRetriever.cs
Show resolved
Hide resolved
...nt/src/AccessTokenManagement.OpenIdConnect/Internal/OpenIdConnectUserAccessTokenRetriever.cs
Show resolved
Hide resolved
- The `OpenIdConnectUserAccessTokenRetriever` was not setting the `Assertion` nor was it being set after running the `ITokenRequestCustomizer`. - Add additional tests to ensure that the correct properties are being set via the TokenRequestCustomizer
52980e5 to
3bb0f73
Compare
Erwinvandervalk
approved these changes
Nov 11, 2025
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.
In the
OpenIdConnectUserAccessTokenRetrievertheAssertionproperty was not set on theUserTokenRequestParametersnor was it being set after running theITokenRequestCustomizer.