Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lms/djangoapps/student_account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,25 @@ def login_and_registration_form(request, initial_mode="login"):
if ext_auth_response is not None:
return ext_auth_response

third_party_auth = _third_party_auth_context(request, redirect_to)
if not third_party_auth['currentProvider']:
if settings.APPSEMBLER_FEATURES.get('ENABLE_EXCLUSIVE_SSO_LOGISTRATION'):
urls_dict = configuration_helpers.get_value(
'EXCLUSIVE_SSO_LOGISTRATION_URL_MAP',
settings.EXCLUSIVE_SSO_LOGISTRATION_URL_MAP)

if initial_mode == 'register':
if 'register' in urls_dict:
return redirect(urls_dict['register'])
else:
return redirect(urls_dict['login'])

# Otherwise, render the combined login/registration page
context = {
'data': {
'login_redirect_url': redirect_to,
'initial_mode': initial_mode,
'third_party_auth': _third_party_auth_context(request, redirect_to),
'third_party_auth': third_party_auth,
'third_party_auth_hint': third_party_auth_hint or '',
'platform_name': configuration_helpers.get_value('PLATFORM_NAME', settings.PLATFORM_NAME),
'support_link': configuration_helpers.get_value('SUPPORT_SITE_LINK', settings.SUPPORT_SITE_LINK),
Expand Down
2 changes: 2 additions & 0 deletions lms/envs/aws_appsembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@
#default behavior is to replace the existing backends with those in APPSEMBLER_FEATURES
AUTHENTICATION_BACKENDS = tuple(APPSEMBLER_FEATURES['LMS_AUTHENTICATION_BACKENDS'])

EXCLUSIVE_SSO_LOGISTRATION_URL_MAP = ENV_TOKENS.get('EXCLUSIVE_SSO_LOGISTRATION_URL_MAP', {})

#attempt to import model from our custom fork of edx-organizations
# if it works, then also add the middleware
try:
Expand Down
2 changes: 2 additions & 0 deletions lms/envs/devstack_appsembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
#default behavior is to replace the existing backends with those in APPSEMBLER_FEATURES
AUTHENTICATION_BACKENDS = tuple(APPSEMBLER_FEATURES['LMS_AUTHENTICATION_BACKENDS'])

EXCLUSIVE_SSO_LOGISTRATION_URL_MAP = ENV_TOKENS.get('EXCLUSIVE_SSO_LOGISTRATION_URL_MAP', {})

#attempt to import model from our custom fork of edx-organizations
# if it works, then also add the middleware
try:
Expand Down