Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix assertions being removed from dict before callback is executed #2733

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -816,15 +816,17 @@ private void NotifyCertificateSelection(MergedOptions mergedOptions, IConfidenti
// Special case when the OBO inbound token is composite (for instance PFT)
if (dict.ContainsKey(assertionConstant) && dict.ContainsKey(subAssertionConstant))
{
string assertion = dict[assertionConstant];
string subAssertion = dict[subAssertionConstant];

// Check assertion and sub_assertion passed from merging extra query parameters to ensure they do not contain unsupported character(s).
CheckAssertionsForInjectionAttempt(dict[assertionConstant], dict[subAssertionConstant]);
CheckAssertionsForInjectionAttempt(assertion, subAssertion);

builder.OnBeforeTokenRequest((data) =>
{
// Replace the assertion and adds sub_assertion with the values from the extra query parameters
data.BodyParameters[assertionConstant] = dict[assertionConstant];
data.BodyParameters.Add(subAssertionConstant, dict[subAssertionConstant]);
data.BodyParameters[assertionConstant] = assertion;
data.BodyParameters.Add(subAssertionConstant, subAssertion);
return Task.CompletedTask;
});

Expand Down
Loading