diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 091840a8bf..7fcda29dd4 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -286,6 +286,11 @@ INSTALLED_APPS = [ 'allauth.socialaccount', # Use 'social' providers ] +# Load the allauth social backends +SOCIAL_BACKENDS = CONFIG.get('social_backends', []) +for app in SOCIAL_BACKENDS: + INSTALLED_APPS.append(app) + MIDDLEWARE = CONFIG.get('middleware', [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', diff --git a/InvenTree/config_template.yaml b/InvenTree/config_template.yaml index 0e6232d270..177b1eaf0a 100644 --- a/InvenTree/config_template.yaml +++ b/InvenTree/config_template.yaml @@ -157,3 +157,7 @@ static_root: '/home/inventree/data/static' # - 'django.contrib.messages.middleware.MessageMiddleware' # - 'django.middleware.clickjacking.XFrameOptionsMiddleware' # - 'InvenTree.middleware.AuthRequiredMiddleware' + +# Add SSO login-backends +# social_backends: +# - 'allauth.socialaccount.providers.github'