Skip to content

Commit f1fa204

Browse files
committed
PR Feedback
1 parent fa32189 commit f1fa204

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/UserFederatedIdentityCredentialParameters.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ public Map<String, String> extraHttpHeaders() {
131131
return this.extraHttpHeaders;
132132
}
133133

134+
/**
135+
* @deprecated Present only to satisfy the {@link IAcquireTokenParameters} interface contract.
136+
* Not recommended for use — this API is scheduled for removal across all parameter classes
137+
* and will be replaced by a new mechanism in a future release.
138+
*/
139+
@Deprecated
134140
public Map<String, String> extraQueryParameters() {
135141
return this.extraQueryParameters;
136142
}
@@ -201,8 +207,11 @@ public UserFederatedIdentityCredentialParametersBuilder extraHttpHeaders(Map<Str
201207
}
202208

203209
/**
204-
* Adds additional parameters to the token request.
210+
* @deprecated Present only to satisfy the {@link IAcquireTokenParameters} interface contract.
211+
* Not recommended for use — this API is scheduled for removal across all parameter classes
212+
* and will be replaced by a new mechanism in a future release.
205213
*/
214+
@Deprecated
206215
public UserFederatedIdentityCredentialParametersBuilder extraQueryParameters(Map<String, String> extraQueryParameters) {
207216
this.extraQueryParameters = extraQueryParameters;
208217
return this;

msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/UserFederatedIdentityCredentialRequest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@ private static OAuthAuthorizationGrant createMsalGrant(UserFederatedIdentityCred
3030
params.put(GrantConstants.USERNAME_PARAMETER, parameters.username());
3131
}
3232

33-
if (parameters.claims() != null) {
34-
params.put("claims", parameters.claims().formatAsJSONString());
35-
}
36-
37-
// OAuthAuthorizationGrant constructor automatically adds:
38-
// - scope augmented with openid, offline_access, profile (COMMON_SCOPES)
39-
// - client_info=1
40-
return new OAuthAuthorizationGrant(params, parameters.scopes());
33+
// Use the 3-arg constructor so that claims are properly set on the grant object.
34+
// This ensures TokenRequestExecutor can correctly merge user claims with clientCapabilities
35+
// rather than silently overwriting them.
36+
return new OAuthAuthorizationGrant(params, parameters.scopes(), parameters.claims());
4137
}
4238

4339
UserFederatedIdentityCredentialParameters parameters() {

0 commit comments

Comments
 (0)