Removed the waffle switch ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER (#27379)
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
"""
|
||||
Waffle flags and switches for third party auth .
|
||||
"""
|
||||
|
||||
|
||||
from edx_toggles.toggles import WaffleSwitch
|
||||
|
||||
WAFFLE_NAMESPACE = 'third_party_auth'
|
||||
|
||||
# .. toggle_name: third_party_auth.enable_multiple_sso_accounts_association_to_saml_user
|
||||
# .. toggle_implementation: WaffleSwitch
|
||||
# .. toggle_default: False
|
||||
# .. toggle_description: If enabled than learner should not be prompted for their edX password arriving via SAML
|
||||
# and already linked to the enterprise customer linked to the same IdP."
|
||||
# .. toggle_use_cases: temporary
|
||||
# .. toggle_creation_date: 2021-01-29
|
||||
# .. toggle_target_removal_date: 2021-04-31
|
||||
# .. toggle_tickets: ENT-4034
|
||||
ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER = WaffleSwitch(
|
||||
f'{WAFFLE_NAMESPACE}.enable_multiple_sso_accounts_association_to_saml_user',
|
||||
__name__
|
||||
)
|
||||
@@ -87,7 +87,6 @@ from lms.djangoapps.verify_student.models import SSOVerification
|
||||
from lms.djangoapps.verify_student.utils import earliest_allowed_verification_date
|
||||
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
|
||||
from openedx.core.djangoapps.user_api import accounts
|
||||
from openedx.core.djangoapps.user_api.accounts.utils import is_multiple_sso_accounts_association_to_saml_user_enabled
|
||||
from openedx.core.djangoapps.user_authn import cookies as user_authn_cookies
|
||||
from openedx.core.djangoapps.user_authn.toggles import is_require_third_party_auth_enabled
|
||||
from common.djangoapps.third_party_auth.utils import (
|
||||
@@ -826,19 +825,16 @@ def associate_by_email_if_saml(auth_entry, backend, details, user, strategy, *ar
|
||||
'Provider ID: %s, Exception: %s', current_user.id, current_user.email,
|
||||
current_provider.provider_id, ex)
|
||||
|
||||
# this is waffle switch to enable and disable this functionality from admin panel.
|
||||
if is_multiple_sso_accounts_association_to_saml_user_enabled():
|
||||
saml_provider, current_provider = is_saml_provider(strategy.request.backend.name, kwargs)
|
||||
|
||||
saml_provider, current_provider = is_saml_provider(strategy.request.backend.name, kwargs)
|
||||
if saml_provider:
|
||||
# get the user by matching email if the pipeline user is not available.
|
||||
current_user = user if user else get_user()
|
||||
|
||||
if saml_provider:
|
||||
# get the user by matching email if the pipeline user is not available.
|
||||
current_user = user if user else get_user()
|
||||
|
||||
# Verify that the user linked to enterprise customer of current identity provider and an active user
|
||||
associate_response = associate_by_email_if_enterprise_user() if current_user else None
|
||||
if associate_response:
|
||||
return associate_response
|
||||
# Verify that the user linked to enterprise customer of current identity provider and an active user
|
||||
associate_response = associate_by_email_if_enterprise_user() if current_user else None
|
||||
if associate_response:
|
||||
return associate_response
|
||||
|
||||
|
||||
def user_details_force_sync(auth_entry, strategy, details, user=None, *args, **kwargs): # lint-amnesty, pylint: disable=keyword-arg-before-vararg
|
||||
|
||||
@@ -13,7 +13,6 @@ from django.conf import settings
|
||||
from django.utils.translation import ugettext as _
|
||||
from social_django.models import UserSocialAuth
|
||||
|
||||
from common.djangoapps.third_party_auth.config.waffle import ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER
|
||||
from common.djangoapps.student.models import AccountRecovery, Registration, get_retired_email_by_email
|
||||
from openedx.core.djangolib.oauth2_retirement_utils import retire_dot_oauth2_models
|
||||
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
||||
@@ -203,16 +202,6 @@ def is_multiple_user_enterprises_feature_enabled():
|
||||
return ENABLE_MULTIPLE_USER_ENTERPRISES_FEATURE.is_enabled()
|
||||
|
||||
|
||||
def is_multiple_sso_accounts_association_to_saml_user_enabled():
|
||||
"""
|
||||
Checks to see if the django-waffle switch for enabling the multiple sso accounts association to saml user is active
|
||||
|
||||
Returns:
|
||||
Boolean value representing switch status
|
||||
"""
|
||||
return ENABLE_MULTIPLE_SSO_ACCOUNTS_ASSOCIATION_TO_SAML_USER.is_enabled()
|
||||
|
||||
|
||||
def create_retirement_request_and_deactivate_account(user):
|
||||
"""
|
||||
Adds user to retirement queue, unlinks social auth accounts, changes user passwords
|
||||
|
||||
Reference in New Issue
Block a user