mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Only check REMOTE_AUTH_BACKEND in API token auth
This commit is contained in:
parent
a3d40e3521
commit
b814123ede
@ -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
|
if settings.REMOTE_AUTH_BACKEND == 'netbox.authentication.LDAPBackend':
|
||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user