-
Notifications
You must be signed in to change notification settings - Fork 155
Deprecate ResponseMode.QUERY in system browser auth flow, automatically override to FORM_POST with warning #1004
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
base: dev
Are you sure you want to change the base?
Conversation
…ly override to FORM_POST with warning
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.
Pull request overview
This pull request deprecates the ResponseMode.QUERY option in the system browser authentication flow due to lack of support. When developers pass ResponseMode.QUERY, it is now automatically overridden to ResponseMode.FORM_POST with a warning log message, ensuring backward compatibility.
Changes:
- Added deprecation annotation to
ResponseMode.QUERYenum value with documentation explaining the override behavior - Implemented automatic override logic in
AuthorizationRequestUrlParametersto convert QUERY to FORM_POST with a warning log - Replaced comprehensive optional parameters test with a focused test for QUERY override behavior
- Added build artifact (log4j.properties) to version control
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ResponseMode.java | Added deprecation annotation and documentation to QUERY enum value |
| msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthorizationRequestUrlParameters.java | Implemented override logic to convert QUERY to FORM_POST with warning, added deprecation to responseMode() method |
| msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/AuthorizationRequestUrlParametersTest.java | Replaced comprehensive optional parameters test with focused QUERY override validation test |
| msal4j-persistence-extension/target/test-classes/log4j.properties | Added log4j configuration file in build output directory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
msal4j-persistence-extension/target/test-classes/log4j.properties
Outdated
Show resolved
Hide resolved
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthorizationRequestUrlParameters.java
Outdated
Show resolved
Hide resolved
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/AuthorizationRequestUrlParametersTest.java
Show resolved
Hide resolved
| this.responseMode = builder.responseMode; | ||
| requestParameters.put("response_mode", | ||
| builder.responseMode.toString()); | ||
| // Override QUERY with FORM_POST as QUERY is deprecated |
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.
Rather than add the logic to check for Query here, it might be simpler to add an if statement to the actual builder method:
public Builder responseMode(ResponseMode val) {
// Override QUERY with FORM_POST as QUERY is deprecated
if (val == ResponseMode.QUERY) {
LOG.warn("ResponseMode.QUERY is deprecated and will be removed in a future release. " +
"Automatically overriding to ResponseMode.FORM_POST.");
this.responseMode = ResponseMode.FORM_POST;
} else {
this.responseMode = val;
}
return self();
}
That way, this constructor stays the same and only valid values get set in the builder.
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.
Agreed, we should not change the AuthCodeUri for all scenarios. Or change it, but deprecate the "GetAuthorizationRequestUri" existing API and add a "GetAuthorizationRequestUriWithPost" and fully deprecate ResponseMode param
Avery-Dunn
left a comment
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 above comments: looks like there are some unnecessary additions and changes to the tests.
…nRequestUrlParameters.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| @@ -0,0 +1,10 @@ | |||
| # This file is located under the Maven/Gradle build output directory: | |||
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.
This file can be removed entirely, it's in the "target" directory which means it's just a file that gets made when building the project and seems to just have some comments from Copilot?
The system browser authentication flow no longer supports query response mode. This change deprecates ResponseMode.QUERY . When developers pass ResponseMode.QUERY, it will be automatically overridden to FORM_POST with a warning log, ensuring backward compatibility while guiding users to the supported mode.