Skip to content

Add correlationId to POST request query params#8308

Open
hectormmg wants to merge 4 commits intodevfrom
post-correlation-id
Open

Add correlationId to POST request query params#8308
hectormmg wants to merge 4 commits intodevfrom
post-correlation-id

Conversation

@hectormmg
Copy link
Member

This pull request adds support for propagating the correlationId in authorization requests to ensure traceability across services. The main changes involve updating the getEARForm and getCodeForm functions to include the correlationId in the query parameters, and adding tests to verify this behavior.

Enhancements to correlationId propagation:

  • Updated getEARForm and getCodeForm in Authorize.ts to add the correlationId to the query parameters, allowing gateways to propagate it to identity providers. [1] [2]

Testing improvements:

  • Added and updated tests in Authorize.spec.ts to verify that the correlationId is present in both the post body and query parameters of the authorization forms. [1] [2]

@hectormmg hectormmg marked this pull request as ready for review February 7, 2026 01:42
@hectormmg hectormmg requested a review from a team as a code owner February 7, 2026 01:42
Copilot AI review requested due to automatic review settings February 7, 2026 01:42
Copy link
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

Propagates correlationId into the /authorize POST form action URL query string in msal-browser to improve end-to-end request traceability (e.g., through gateways), with accompanying unit tests to validate behavior.

Changes:

  • Add client-request-id (correlationId) to the query params used for the form action URL in getEARForm and getCodeForm.
  • Extend protocol tests to verify correlationId appears in both the POST body inputs and the form action URL query string.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/msal-browser/src/protocol/Authorize.ts Adds correlationId to the query params Map used to build the form action URL for EAR and auth-code POST forms.
lib/msal-browser/test/protocol/Authorize.spec.ts Adds assertions/tests to ensure correlationId is present in the authorize URL query params (EAR) and both query + body (code form).

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant