Skip to content

feat: default the authn MFE (logistration) on - #39092

Draft
feanil wants to merge 4 commits into
masterfrom
feanil/enable-authn-mfe-default
Draft

feanil wants to merge 4 commits into
masterfrom
feanil/enable-authn-mfe-default

Conversation

@feanil

@feanil feanil commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Flip ENABLE_AUTHN_MICROFRONTEND to default True so vanilla installs serve the frontend-app-authn login/registration experience by default, matching Tutor deployments (which already enable it). Operators can still opt out with EDXAPP_ENABLE_AUTHN_MFE=False in Tutor, or by setting ENABLE_AUTHN_MICROFRONTEND to false in your custom settings file.

This is the "make it default-on in the platform" step ahead of removing the legacy logistration views.

Enterprise / SSO impact

None. The has_external_provider guard in openedx/core/djangoapps/user_authn/views/login_form.py:176-190 keeps SAML/TPA (including enterprise SSO) learners on the legacy page regardless of this flag, until the authn MFE renders those flows (openedx/frontend-app-authn#1691). Non-enterprise learners are already at parity in the MFE.

References

Flip ENABLE_AUTHN_MICROFRONTEND to default True so vanilla installs serve
the frontend-app-authn login/registration experience by default, matching
Tutor deployments which already enable it.  Operators can still opt out
with EDXAPP_ENABLE_AUTHN_MFE=False.

Enterprise/SAML/TPA learners are unaffected: the has_external_provider
guard in login_form.py keeps them on the legacy page until the authn MFE
renders those flows (openedx/frontend-app-authn#1691).

Part of the legacy logistration removal (openedx/public-engineering#81),
tracked in #38936.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@feanil
feanil requested a review from kdmccormick September 10, 2026 16:53
@feanil
feanil marked this pull request as ready for review September 10, 2026 16:53
@feanil
feanil marked this pull request as draft September 14, 2026 13:52
feanil and others added 3 commits September 14, 2026 10:07
These tests all assert the same incidental thing: an unauthenticated
request gets bounced to the login page.  None of them care about what the
login page then renders, but assertRedirects fetches the redirect target
and requires a 200 from it by default, so they were all coupled to it
anyway.  With the authn MFE on by default /login answers a 302 and every
one of them fails with "Couldn't retrieve redirection page '/login'".

Pass fetch_redirect_response=False so they assert the redirect target and
stop there.  That is the behavior each of these tests is actually about,
and it holds whichever logistration frontend is in use.

course_wiki gets the same treatment in a different shape.  It followed
the whole chain and checked the last hop, which now loops forever: the
test settings point AUTHN_MICROFRONTEND_URL at http://authn-mfe, and the
test client resolves that host against the same URLconf, so /login
forwards to itself until Django raises RedirectCycleError.  There is no
chain to follow in the first place - WikiAccessMiddleware redirects
straight to signin_user (lms/djangoapps/course_wiki/middleware.py:55) -
so assert on the first Location instead.

The theming test loses its LMS/Studio branch on target_status_code for
the same reason; both sides now redirect onward.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…=False

These tests are about the legacy combined login/registration page itself -
its rendered context, its TPA provider list and hinted-login dialog, the
Register link that ALLOW_PUBLIC_ACCOUNT_CREATION hides, the filters that
fire while it renders, the activation redirects, and the reset link the
recover_account command mails out.  They assert on that page's content, so
they only make sense with the flag that serves it.

Flipping the default sent /login, /register and /password_assistance on to
the authn MFE and turned all of them into "302 != 200".  Pin the flag off
at the class (or method, for the one-off in the support tests) so they keep
covering the legacy page, which is still reachable: operators can opt out
with EDXAPP_ENABLE_AUTHN_MFE=False, ?skip_authn_mfe short-circuits the
redirect, and SAML/TPA learners stay on it via the has_external_provider
guard in login_form.py.  The MFE-path cases in these same classes already
carry their own per-method override and keep winning over the class one.

These pins come out when the legacy page is deleted, along with the tests.
Part of openedx/public-engineering#81, tracked in #38936.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The matrix has no fail-fast setting, so it takes the GitHub default of
true: the first shard to fail cancels the other nine.  On run 34504727200
that meant lms-3 and lms-5 reported 12 failures while lms-1, lms-2, lms-4,
cms-2 and all three shared-with-* shards were killed mid-run, hiding at
least another 70 in common/ and openedx/ - the densest area for this
change.  Chasing them one shard per push is slow.

Turn fail-fast off so every shard finishes and we get the whole list in a
single run.  Revert this commit before the PR merges.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good in theory 👍🏻 LMK when you want final review.

I would use a feat!: commit with BREAKING CHANGE: ... to note the new default.

Comment on lines +28 to +30
# ENABLE_AUTHN_MICROFRONTEND defaults to True, which sends /login and /register on to the
# authn MFE. Most of this class covers the legacy page these URLs still render when the MFE
# is off, so pin the flag here; the handful of MFE-redirect tests re-enable it per-method.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should all the ENABLE_AUTHN_MICROFRONTEND=False test methods be deleted when legacy logistration is removed? or is there core logic being tested that we need to factor out?



@skip_unless_lms
@override_settings(ENABLE_AUTHN_MICROFRONTEND=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same question: delete this whole test class when legacy logistration is removed? or is there core logic being tested that we need to factor out?

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.

2 participants