Skip to content
Snippets Groups Projects
Commit cc52ab29 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Allow authentication by *ModelBackend

We had removed the ability for GraceDbModelBackend to do
authentication, but it is relied on for basic auth by the
BasicAuthentication class in django-rest-framework.  So we undo
that change and remove the GraceDbModelBackend class altogether
in favor of its parent, ModelPermissionsForObjectBackend.
parent 18cf97db
No related branches found
No related tags found
No related merge requests found
......@@ -308,7 +308,7 @@ X509_ISSUER_DN_HEADER = 'HTTP_SSL_CLIENT_I_DN'
# handled by the REST_FRAMEWORK dictionary.
AUTHENTICATION_BACKENDS = [
'ligoauth.backends.ShibbolethRemoteUserBackend',
'ligoauth.backends.GraceDbModelBackend',
'ligoauth.backends.ModelPermissionsForObjectBackend',
'guardian.backends.ObjectPermissionBackend',
]
......
......@@ -36,16 +36,6 @@ class ModelPermissionsForObjectBackend(backends.ModelBackend):
perm, obj=None)
class GraceDbModelBackend(ModelPermissionsForObjectBackend):
"""
Main permission-checking backend for GraceDB. We remove the ability
for this backend to authenticate users, since that is handled by other
auth backends.
"""
def authenticate(self, request, username=None, password=None, **kwargs):
return None
class ShibbolethRemoteUserBackend(backends.RemoteUserBackend):
"""
Almost completely taken from Django's RemoteUserBackend, but we have to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment