mirror of
https://github.com/veops/cmdb.git
synced 2025-08-07 20:48:31 +08:00
fix(api): ldap authentication
This commit is contained in:
@@ -39,7 +39,7 @@ class LoginView(APIView):
|
||||
password = request.values.get("password")
|
||||
_role = None
|
||||
config = AuthenticateDataCRUD(AuthenticateType.LDAP).get()
|
||||
if config.get('LDAP', {}).get('enabled'):
|
||||
if config.get('LDAP', {}).get('enabled') or config.get('LDAP', {}).get('enable'):
|
||||
from api.lib.perm.authentication.ldap import authenticate_with_ldap
|
||||
user, authenticated = authenticate_with_ldap(username, password)
|
||||
else:
|
||||
|
@@ -1,9 +1,10 @@
|
||||
from flask import abort, request
|
||||
|
||||
from api.lib.common_setting.common_data import AuthenticateDataCRUD
|
||||
from api.lib.common_setting.const import TestType
|
||||
from api.lib.common_setting.resp_format import ErrFormat
|
||||
from api.lib.perm.acl.acl import role_required
|
||||
from api.resource import APIView
|
||||
from api.lib.common_setting.common_data import AuthenticateDataCRUD
|
||||
from api.lib.common_setting.resp_format import ErrFormat
|
||||
|
||||
prefix = '/auth_config'
|
||||
|
||||
|
Reference in New Issue
Block a user