|
@@ -37,7 +37,7 @@ class LDAPAuth(Auth):
|
37
|
37
|
self._config['sa_auth'].authmetadata = LDAPApplicationAuthMetadata(self._config.get('sa_auth'))
|
38
|
38
|
|
39
|
39
|
def _get_ldap_auth(self):
|
40
|
|
- auth_plug = LDAPSearchAuthenticatorPlugin(
|
|
40
|
+ return LDAPSearchAuthenticatorPlugin(
|
41
|
41
|
url=self._config.get('ldap_url'),
|
42
|
42
|
base_dn=self._config.get('ldap_base_dn'),
|
43
|
43
|
bind_dn=self._config.get('ldap_bind_dn'),
|
|
@@ -47,8 +47,6 @@ class LDAPAuth(Auth):
|
47
|
47
|
naming_attribute=self._config.get('ldap_naming_attribute'),
|
48
|
48
|
start_tls=ini_conf_to_bool(self._config.get('ldap_tls', False)),
|
49
|
49
|
)
|
50
|
|
- auth_plug.set_auth(self)
|
51
|
|
- return auth_plug
|
52
|
50
|
|
53
|
51
|
def _get_ldap_user_provider(self):
|
54
|
52
|
return LDAPAttributesPlugin(
|
|
@@ -76,14 +74,6 @@ class LDAPAuth(Auth):
|
76
|
74
|
|
77
|
75
|
class LDAPSearchAuthenticatorPlugin(BaseLDAPSearchAuthenticatorPlugin):
|
78
|
76
|
|
79
|
|
- def __init__(self, *args, **kwargs):
|
80
|
|
- super().__init__(*args, **kwargs)
|
81
|
|
- self._auth = None
|
82
|
|
- self._user_api = UserApi(None)
|
83
|
|
-
|
84
|
|
- def set_auth(self, auth):
|
85
|
|
- self._auth = auth
|
86
|
|
-
|
87
|
77
|
def authenticate(self, environ, identity):
|
88
|
78
|
# Note: super().authenticate return None if already authenticated or not found
|
89
|
79
|
email = super().authenticate(environ, identity)
|