Skip to content

Revert "fix: fixed the redirection logic"#123

Merged
subhashree-sahu31 merged 1 commit intorelease-ulmofrom
revert-121-AUT-60-implement-waffle-gated-auth-n-mfe-redirection-for-enterprise-b-2-b-users
Feb 13, 2026
Merged

Revert "fix: fixed the redirection logic"#123
subhashree-sahu31 merged 1 commit intorelease-ulmofrom
revert-121-AUT-60-implement-waffle-gated-auth-n-mfe-redirection-for-enterprise-b-2-b-users

Conversation

@subhashree-sahu31
Copy link

Reverts #121

Copilot AI review requested due to automatic review settings February 13, 2026 13:49
Copy link

Copilot AI left a 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 reverts PR #121, which had modified the redirection logic for the authentication microfrontend (MFE). The revert reinstates logic that blocks ALL third-party authentication flows (SAML, OAuth, and others) from redirecting to the MFE, rather than potentially blocking only SAML providers.

Changes:

  • Added has_running_pipeline check to detect any active third-party auth pipeline
  • Simplified SAML provider detection to always use is_saml_provider() utility function
  • Updated has_external_provider condition to include any running pipeline, not just SAML

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 226 to +235
# Also explicitly check for SAML if pipeline exists
saml_provider = False
if running_pipeline:
backend_name = running_pipeline.get("backend")
kwargs = running_pipeline.get("kwargs", {})
# Check if backend is SAML (either explicitly 'tpa-saml' or via provider registry)
if backend_name == 'tpa-saml':
saml_provider = True
else:
# Also check via provider registry (for configured SAML providers)
saml_provider, __ = third_party_auth.utils.is_saml_provider(
backend=backend_name,
kwargs=kwargs,
)
# is_saml_provider returns a tuple (bool, provider_name)
saml_provider, __ = third_party_auth.utils.is_saml_provider(
backend=backend_name,
kwargs=kwargs,
)
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The SAML provider check on lines 227-235 is redundant. Since has_running_pipeline is already included in the has_external_provider condition on line 239, and this check only executes when running_pipeline is not None (which is the same as has_running_pipeline being True), the result of saml_provider doesn't affect the final outcome. Whether the running pipeline is SAML or not, has_running_pipeline will be True and will block the MFE redirect regardless. Consider removing this redundant check to simplify the logic.

Copilot uses AI. Check for mistakes.
# If there's ANY running pipeline, treat it as an external provider
# This handles SAML, OAuth, and any other third-party auth flows
has_running_pipeline = running_pipeline is not None
# Also explicitly check for SAML if pipeline exists
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The comment "Also explicitly check for SAML if pipeline exists" is misleading. Since has_running_pipeline is included in the has_external_provider check on line 239, this SAML check is redundant. When a pipeline exists (any type), has_running_pipeline will be True and will block MFE redirect regardless of whether it's SAML or another provider type like OAuth. Either remove this redundant check or update the comment to explain why it's needed (if there's a valid reason not apparent from the code).

Copilot uses AI. Check for mistakes.
@@ -220,24 +220,23 @@ def _maybe_redirect_to_authn_mfe(request, initial_mode, redirect_to):
# External providers (SAML / TPA hint) must NEVER redirect to MFE.
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The comment on line 220 states "External providers (SAML / TPA hint)" but the code now blocks ALL third-party auth providers, not just SAML. The comments on lines 221 and 224 confirm this is intentional ("catches all third-party auth" and "SAML, OAuth, and any other third-party auth flows"). Consider updating line 220 to say "External providers (all third-party auth / TPA hint)" to accurately reflect the actual behavior.

Suggested change
# External providers (SAML / TPA hint) must NEVER redirect to MFE.
# External providers (all third-party auth / TPA hint) must NEVER redirect to MFE.

Copilot uses AI. Check for mistakes.
@subhashree-sahu31 subhashree-sahu31 merged commit 1605065 into release-ulmo Feb 13, 2026
70 checks passed
@subhashree-sahu31 subhashree-sahu31 deleted the revert-121-AUT-60-implement-waffle-gated-auth-n-mfe-redirection-for-enterprise-b-2-b-users branch February 13, 2026 14:17
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