Skip to content

Commit

Permalink
Keep user on FE if there is a running pipeline for SAML IDPs.
Browse files Browse the repository at this point in the history
For some SAML providers, learners are redirected to MFE and breaking
the flow. Check for running pipeline and if the provider is a SAML
provider keep them on FE.

VAN-425
  • Loading branch information
waheedahmed committed Mar 25, 2021
1 parent 9a24e72 commit b200699
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions openedx/core/djangoapps/user_authn/views/login_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,16 @@ def login_and_registration_form(request, initial_mode="login"):
except (KeyError, ValueError, IndexError) as ex:
log.exception(u"Unknown tpa_hint provider: %s", ex)

# Redirect to authn MFE if it is enabled or user is not an enterprise user or not coming from a SAML IDP.
saml_provider = False
running_pipeline = pipeline.get(request)
enterprise_customer = enterprise_customer_for_request(request)
# Redirect to authn MFE if it is enabled
if should_redirect_to_authn_microfrontend() and not enterprise_customer:
if running_pipeline:
saml_provider, __ = third_party_auth.utils.is_saml_provider(
running_pipeline.get('backend'), running_pipeline.get('kwargs')
)

if should_redirect_to_authn_microfrontend() and not enterprise_customer and not saml_provider:

# This is to handle a case where a logged-in cookie is not present but the user is authenticated.
# Note: If we don't handle this learner is redirected to authn MFE and then back to dashboard
Expand Down

0 comments on commit b200699

Please sign in to comment.