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

Setting the correlation id for token request command #2413

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

SaurabhMSFT
Copy link
Contributor

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.

@SaurabhMSFT SaurabhMSFT requested a review from a team as a code owner May 23, 2024 15:11
@@ -857,6 +857,7 @@ protected TokenResult performSilentTokenRequest(
((MicrosoftTokenRequest) refreshTokenRequest).setClaims(parameters.getClaimsRequestJson());
((MicrosoftTokenRequest) refreshTokenRequest).setClientAppName(parameters.getApplicationName());
((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getApplicationVersion());
((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getCorrelationId());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@SammyO @shahzaibj @fadidurah Discussion from the old PR in below screenshot.
image

@@ -857,6 +857,7 @@ protected TokenResult performSilentTokenRequest(
((MicrosoftTokenRequest) refreshTokenRequest).setClaims(parameters.getClaimsRequestJson());
((MicrosoftTokenRequest) refreshTokenRequest).setClientAppName(parameters.getApplicationName());
((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getApplicationVersion());
((MicrosoftTokenRequest) refreshTokenRequest).setClientAppVersion(parameters.getCorrelationId());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we setting correlation id as client app version?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's a mistake, let me update this as Saurabh is OOO.

Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

@SaurabhMSFT did you test this? In my tests the request is not an instance of MicrosoftTokenRequest, so this code is not executed.

Copy link
Contributor

@shahzaibj shahzaibj left a comment

Choose a reason for hiding this comment

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

See comments

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.

4 participants