Răsfoiți Sursa

Only check REMOTE_AUTH_BACKEND in API token auth

Tobias Genannt 4 ani în urmă
părinte
comite
b814123ede
1 a modificat fișierele cu 1 adăugiri și 2 ștergeri
  1. 1 2
      netbox/netbox/api/authentication.py

+ 1 - 2
netbox/netbox/api/authentication.py

@@ -26,8 +26,7 @@ class TokenAuthentication(authentication.TokenAuthentication):
             raise exceptions.AuthenticationFailed("User inactive")
             raise exceptions.AuthenticationFailed("User inactive")
 
 
         # When LDAP authentication is active try to load user data from LDAP directory
         # When LDAP authentication is active try to load user data from LDAP directory
-        if (settings.REMOTE_AUTH_ENABLED and
-                settings.REMOTE_AUTH_BACKEND == 'netbox.authentication.LDAPBackend'):
+        if settings.REMOTE_AUTH_BACKEND == 'netbox.authentication.LDAPBackend':
             from netbox.authentication import LDAPBackend
             from netbox.authentication import LDAPBackend
             ldap_backend = LDAPBackend()
             ldap_backend = LDAPBackend()
             user = ldap_backend.populate_user(token.user.username)
             user = ldap_backend.populate_user(token.user.username)