Setting the correlation id for token request command#2413
Open
SaurabhMSFT wants to merge 3 commits intodevfrom
Open
Setting the correlation id for token request command#2413SaurabhMSFT wants to merge 3 commits intodevfrom
SaurabhMSFT wants to merge 3 commits intodevfrom
Conversation
SaurabhMSFT
commented
May 23, 2024
| ((MicrosoftTokenRequest) refreshTokenRequest).setClaims(parameters.getClaimsRequestJson()); | ||
| ((MicrosoftTokenRequest) refreshTokenRequest).setClientAppName(parameters.getApplicationName()); | ||
| ((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getApplicationVersion()); | ||
| ((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getCorrelationId()); |
Contributor
Author
There was a problem hiding this comment.
@SammyO @shahzaibj @fadidurah Discussion from the old PR in below screenshot.

shahzaibj
reviewed
May 28, 2024
| ((MicrosoftTokenRequest) refreshTokenRequest).setClaims(parameters.getClaimsRequestJson()); | ||
| ((MicrosoftTokenRequest) refreshTokenRequest).setClientAppName(parameters.getApplicationName()); | ||
| ((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getApplicationVersion()); | ||
| ((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getCorrelationId()); |
Contributor
There was a problem hiding this comment.
Why are we setting correlation id as client app version?
Contributor
There was a problem hiding this comment.
That's a mistake, let me update this as Saurabh is OOO.
Contributor
There was a problem hiding this comment.
Updated. @shahzaibj please re-review. Specifically:
- if the correlation ID in the parameter object isn't set, this will explicitly set the correlation ID in the request to null. Is that a problem? Is there another place in the code that checks whether the correlation ID is null and if so sets it to something (e.g. the API layer)?
- are there other unwanted side-effects of this change?
Contributor
There was a problem hiding this comment.
@SaurabhMSFT did you test this? In my tests the request is not an instance of MicrosoftTokenRequest, so this code is not executed.
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.
This change has been moved out of PR #2390 . NativeAuth is now using the SilentTokenCommand for requesting new tokens and performing token refresh. The correlation id from the account state object is used for sending the request.