-
Notifications
You must be signed in to change notification settings - Fork 36
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
base: dev
Are you sure you want to change the base?
Conversation
@@ -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()); |
There was a problem hiding this comment.
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.
@@ -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()); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
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.