Add form_post response mode support for system browser authentication#868
Merged
Add form_post response mode support for system browser authentication#868
Conversation
isra-fel
reviewed
Jan 14, 2026
rayluo
requested changes
Jan 21, 2026
Contributor
rayluo
left a comment
There was a problem hiding this comment.
Thanks for the PR which communicated the intention clearly. The implementation needs some change.
MSAL Python code base serves for both public clients and confidential clients. The current architecture is:
- oauth2.py handles all OAuth2 interactions which does NOT include hosting a web server to receive the auth code response. The web server part is controlled by whatever web framework the app developer chooses for their confidential application. We cannot forcefully override our response_mode to form_post, otherwise their existing query-based app would be broken (sev 1). What we can do (in oauth2.py) is to issue a warning when the response_mode value is not "form_post".
- application.py defines the higher-level API that utilizes oauth2.py. So it will automatically trigger that warning in
#1. The only thing needs to be done is to modify its documentation. (More on this below.) - authcode.py is the mini web server implementation that is used by Public Clients (when not using broker). We fully control how this web server is implemented, so, we can simply remove the "auth code via GET" mode, and refactor it to use form_post mode only.
With that context, now my following inline comments shall be easy to understand.
991d4b1 to
3eca00f
Compare
ashok672
commented
Feb 2, 2026
…me page and abort feature
90a7a71 to
57c25d8
Compare
Avery-Dunn
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements support for OAuth 2.0 response_mode=form_post in the system browser authentication flow, aligning with modern OAuth 2.0 best practices (RFC 6749).