Skip to content

Fix #31191: duplicated "scope" parameter - #31419

Merged
chenrujun merged 5 commits into
Azure:mainfrom
chenrujun:fix_bug_31191_The_parameter_scope_is_duplicated
Oct 15, 2022
Merged

Fix #31191: duplicated "scope" parameter#31419
chenrujun merged 5 commits into
Azure:mainfrom
chenrujun:fix_bug_31191_The_parameter_scope_is_duplicated

Conversation

@chenrujun

@chenrujun chenrujun commented Oct 12, 2022

Copy link
Copy Markdown

Fix #31191. duplicated "scope" parameter.

Root Cause Analysis

This bug is caused by a79493d

image

AbstractOAuth2AuthorizationGrantRequestEntityConverter#addParametersConverter is not idempotent, AbstractOAuth2AuthorizationCodeGrantRequestEntityConverter#convert execute multiple times will cause duplicated parameters.

How To Fix

Move the following code into constructor to make sure they only execute once.

addHeadersConverter(this::getHttpHeaders);
addParametersConverter(this::getHttpBody);

@ghost ghost added the azure-spring All azure-spring related issues label Oct 12, 2022
@chenrujun chenrujun self-assigned this Oct 12, 2022
@chenrujun chenrujun added bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. labels Oct 12, 2022
@chenrujun chenrujun added this to the 2022-11 milestone Oct 12, 2022
@azure-sdk

Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

@chenrujun
chenrujun force-pushed the fix_bug_31191_The_parameter_scope_is_duplicated branch from caa3a44 to 5baeae8 Compare October 12, 2022 09:39
@chenrujun
chenrujun merged commit 27c0e8c into Azure:main Oct 15, 2022
@chenrujun
chenrujun deleted the fix_bug_31191_The_parameter_scope_is_duplicated branch October 15, 2022 11:18
Comment on lines +25 to +28
protected AbstractOAuth2AuthorizationCodeGrantRequestEntityConverter() {
addHeadersConverter(this::getHttpHeaders);
addParametersConverter(this::getHttpBody);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

azure-spring All azure-spring related issues bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] The parameter 'scope' is duplicated

5 participants