From cae8950723dbcde382fb5be300fc9c0d71c99cf1 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 14 Feb 2017 10:59:46 -0500 Subject: [PATCH] don't cache social-auth-core backends social-auth-core uses a global variable to cache backend settings: https://github.com/python-social-auth/social-core/blob/78da4eb201dd22fd2d8a4e38a1d17a73beabad24/social_core/backends/utils.py#L9 when loading backends, forcibly ignore this behavior to avoid a thread-safety issue that causes #4788 #4045 --- awx/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index 56d5e7d789..97a90428ce 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -518,7 +518,7 @@ class AuthView(APIView): def get(self, request): data = OrderedDict() err_backend, err_message = request.session.get('social_auth_error', (None, None)) - auth_backends = load_backends(settings.AUTHENTICATION_BACKENDS).items() + auth_backends = load_backends(settings.AUTHENTICATION_BACKENDS, force_load=True).items() # Return auth backends in consistent order: Google, GitHub, SAML. auth_backends.sort(key=lambda x: 'g' if x[0] == 'google-oauth2' else x[0]) for name, backend in auth_backends: