SSO Integrations: No module named social.backends.azuread

I was trying to setup: SSO with azure AD following opnedx docs. After setting up this config, LMS is crashing with below exception. what is easiest way to patch this issue with tutor without rebuilding,

“FEATURES”: {
“ENABLE_LTI_PROVIDER”: true,
“ENABLE_COMBINED_LOGIN_REGISTRATION”: true,
“ENABLE_THIRD_PARTY_AUTH”: true,
}

“THIRD_PARTY_AUTH_BACKENDS”: [“social.backends.azuread.AzureADOAuth2”],

Hi @venkat.330! I believe you forgot to post the exception you are facing.

I though that was the subject …

lms-worker_1        |   File "./manage.py", line 120, in <module>
lms-worker_1        |     startup.run()
lms-worker_1        |   File "/openedx/edx-platform/lms/startup.py", line 19, in run
lms-worker_1        |     django.setup()
lms-worker_1        |   File "/openedx/venv/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
lms-worker_1        |     apps.populate(settings.INSTALLED_APPS)
lms-worker_1        |   File "/openedx/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
lms-worker_1        |     app_config.import_models()
lms-worker_1        |   File "/openedx/venv/local/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
lms-worker_1        |     self.models_module = import_module(models_module_name)
lms-worker_1        |   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
lms-worker_1        |     __import__(name)
lms-worker_1        |   File "/openedx/edx-platform/common/djangoapps/third_party_auth/models.py", line 51, in <module>
lms-worker_1        |     _PSA_BACKENDS = {backend_class.name: backend_class for backend_class in _load_backend_classes()}
Stopping tutor_local_lms_1              ... done
lms-worker_1        |     _PSA_BACKENDS = {backend_class.name: backend_class for backend_class in _load_backend_classes()}
lms-worker_1        |   File "/openedx/edx-platform/common/djangoapps/third_party_auth/models.py", line 48, in _load_backend_classes
lms-worker_1        |     auth_class = module_member(class_path)
lms-worker_1        |   File "/openedx/venv/local/lib/python2.7/site-packages/social_core/utils.py", line 58, in module_member
lms-worker_1        |     module = import_module(mod)
lms-worker_1        |   File "/openedx/venv/local/lib/python2.7/site-packages/social_core/utils.py", line 52, in import_module
lms-worker_1        |     __import__(name)
lms-worker_1        | ImportError: No module named social.backends.azuread

I have never used the Azure identity provider, but I’m pretty sure there is a mistake in the official Open edX docs. Please try with “social_core” instead of “social”:

"THIRD_PARTY_AUTH_BACKENDS": ["social_core.backends.azuread.AzureADOAuth2"]

EDIT: I created a PR to fix the docs upstream https://github.com/edx/edx-documentation/pull/1854

1 Like

Thanks, it worked.:slight_smile: