Skip to content

Commit 66e8e5d

Browse files
committed
add user_format_string to allow use with AD
1 parent 822d884 commit 66e8e5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/service/login_handlers/default.py

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ async def _ldap_login(self, username, password):
5858
dn = self._ldap_config.get('dn')
5959
user_attr = self._ldap_config.get('user_attr') or 'uid'
6060
user_string = '%s=%s,%s' % (user_attr, username, dn)
61+
user_format_string = self._ldap_config.get("user_format") or "{user_attr}={user},{dn}"
62+
user_string = user_format_string.format(user_attr=user_attr, user=username, dn=dn)
6163

6264
try:
6365
with ldap3.Connection(server, user=user_string, password=password) as conn:

0 commit comments

Comments
 (0)