Added a configuration flag to force third party auth (#24789)

This adds a toggle to allow operators to prevent user registration and login via username/password authentication, forcing the platform to only support login and registration using third-party auth such as SAML.

Co-authored-by: Umar Asghar <mrumarasghar@gmail.com>
This commit is contained in:
Tobias Macey
2021-01-07 09:55:27 -05:00
committed by GitHub
parent f62b1c417b
commit 50bb70298c
14 changed files with 152 additions and 29 deletions

View File

@@ -622,6 +622,8 @@ TIME_ZONE_DISPLAYED_FOR_DEADLINES = ENV_TOKENS.get("TIME_ZONE_DISPLAYED_FOR_DEAD
TIME_ZONE_DISPLAYED_FOR_DEADLINES)
##### Third-party auth options ################################################
ENABLE_REQUIRE_THIRD_PARTY_AUTH = ENV_TOKENS.get('ENABLE_REQUIRE_THIRD_PARTY_AUTH', False)
if FEATURES.get('ENABLE_THIRD_PARTY_AUTH'):
tmp_backends = ENV_TOKENS.get('THIRD_PARTY_AUTH_BACKENDS', [
'social_core.backends.google.GoogleOAuth2',