Skip to content

Ensure Assertions are used during Token Refreshes#293

Merged
pgermishuys merged 1 commit intomainfrom
pg/allow-assertions-in-customizer
Nov 11, 2025
Merged

Ensure Assertions are used during Token Refreshes#293
pgermishuys merged 1 commit intomainfrom
pg/allow-assertions-in-customizer

Conversation

@pgermishuys
Copy link
Copy Markdown
Contributor

@pgermishuys pgermishuys commented Nov 11, 2025

In the OpenIdConnectUserAccessTokenRetriever the Assertion property was not set on the UserTokenRequestParameters nor was it being set after running the ITokenRequestCustomizer.

@pgermishuys pgermishuys self-assigned this Nov 11, 2025
@pgermishuys pgermishuys added the area/foss/atm Issues related to Access Token Management label Nov 11, 2025
@pgermishuys pgermishuys force-pushed the pg/allow-assertions-in-customizer branch 3 times, most recently from a7dc1dd to 52980e5 Compare November 11, 2025 14:45
@pgermishuys pgermishuys marked this pull request as ready for review November 11, 2025 14:54
@pgermishuys pgermishuys requested review from a team and Copilot November 11, 2025 14:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Assertion assignment from base parameters
  • Added missing assignments for Assertion, Parameters, and ForceTokenRenewal after 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.

- 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
@pgermishuys pgermishuys force-pushed the pg/allow-assertions-in-customizer branch from 52980e5 to 3bb0f73 Compare November 11, 2025 14:59
@pgermishuys pgermishuys merged commit 4029e63 into main Nov 11, 2025
3 checks passed
@pgermishuys pgermishuys deleted the pg/allow-assertions-in-customizer branch November 11, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/foss/atm Issues related to Access Token Management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants