-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[BUG] On behalf of token payload is wrong in Spring boot 4.x / spring framework 7.x beta #47657
Copy link
Copy link
Closed
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuesAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Metadata
Metadata
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuesAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Type
Projects
Status
Done
Describe the bug
When using the
on_behalf_ofgrant type with Azure AD authentication, theAbstractRestClientOAuth2AccessTokenResponseClientincorrectly merges parameters from multiple converters (DefaultOAuth2TokenRequestParametersConverterandAadJwtBearerGrantRequestParameterConverter). This causes parameter values to be converted into lists instead of single values, resulting in duplicate grant type values being sent to the authorization server.Exception or Stack Trace
To Reproduce
on_behalf_ofgrant typeCode Snippet
The issue occurs in the
addParametersConverter()method inAbstractRestClientOAuth2AccessTokenResponseClient.java. When composing converters, the method usesMultiValueMap.addAll()which appends values to existing keys rather than replacing them:Expected behavior
Parameters should be properly merged such that when multiple converters provide the same parameter key, the final value should be a single string value, not a list. The grant type should appear once as
urn:ietf:params:oauth:grant-type:jwt-bearer, not duplicated.Setup (please complete the following information):
com.azure.spring:spring-cloud-azure-starter:7.0.0-beta.1