Skip to content

Commit

Permalink
fix: correct user restriction behavior by sign up source in eox-tenant (
Browse files Browse the repository at this point in the history
#201)

* fix: fixing login tenant aware

adding new auth backend for nutmeg to be able to use the tenant aware login

* fix: tweaking some code
  • Loading branch information
DeimerM committed Apr 12, 2024
1 parent d0207e8 commit b578820
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
13 changes: 13 additions & 0 deletions eox_tenant/edxapp_wrapper/backends/edx_auth_n_v1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
""" Backend abstraction. """
from django.contrib.auth.backends import AllowAllUsersModelBackend # pylint: disable=import-error
from openedx.core.djangoapps.user_authn.exceptions import AuthFailedError # pylint: disable=import-error


def get_edx_auth_backend():
""" Backend to get the default edx auth backend. """
return AllowAllUsersModelBackend


def get_edx_auth_failed():
""" Backend to get the AuthFailedError class. """
return AuthFailedError
2 changes: 1 addition & 1 deletion eox_tenant/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def plugin_settings(settings):
settings.GET_CERTIFICATES_MODULE = 'eox_tenant.edxapp_wrapper.backends.certificates_module_i_v1'
settings.GET_SITE_CONFIGURATION_MODULE = 'eox_tenant.edxapp_wrapper.backends.site_configuration_module_i_v1'
settings.GET_THEMING_HELPERS = 'eox_tenant.edxapp_wrapper.backends.theming_helpers_h_v1'
settings.EOX_TENANT_EDX_AUTH_BACKEND = "eox_tenant.edxapp_wrapper.backends.edx_auth_i_v1"
settings.EOX_TENANT_EDX_AUTH_BACKEND = "eox_tenant.edxapp_wrapper.backends.edx_auth_n_v1"
settings.EOX_TENANT_USERS_BACKEND = 'eox_tenant.edxapp_wrapper.backends.users_l_v1'
settings.EOX_TENANT_BEARER_AUTHENTICATION = 'eox_tenant.edxapp_wrapper.backends.bearer_authentication_l_v1'
settings.EOX_MAX_CONFIG_OVERRIDE_SECONDS = 300
Expand Down
3 changes: 1 addition & 2 deletions eox_tenant/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

from .common import * # pylint: disable=wildcard-import,unused-wildcard-import

EDX_AUTH_BACKEND = \
'openedx.core.djangoapps.oauth_dispatch.dot_overrides.backends.EdxRateLimitedAllowAllUsersModelBackend'
EDX_AUTH_BACKEND = 'django.contrib.auth.backends.AllowAllUsersModelBackend'
EOX_TENANT_AUTH_BACKEND = 'eox_tenant.auth.TenantAwareAuthBackend'
DJANGO_CURRENT_SITE_MIDDLEWARE = 'django.contrib.sites.middleware.CurrentSiteMiddleware'

Expand Down

0 comments on commit b578820

Please sign in to comment.