Skip to content

Conversation

@ashok672
Copy link
Contributor

@ashok672 ashok672 commented Jan 9, 2026

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).

@ashok672 ashok672 requested a review from a team as a code owner January 9, 2026 02:35
Copy link
Contributor

@rayluo rayluo left a comment

Choose a reason for hiding this comment

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

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:

  1. 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".
  2. 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.)
  3. 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants