mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 06:35:24 +00:00
fix(ldap): preserve the directory-provided bind DN (#1486)
This commit is contained in:
1 parent
4897024324
commit
378be3405a
2 files changed
+37
-8
No files matched your search
@@ -141,12 +141,15 @@ export function createLdapLogin(ctx: PluginContext, store: ProviderStore) {
|
||||
config.displayNameAttribute || "cn",
|
||||
"mail",
|
||||
"email",
|
||||
"distinguishedName",
|
||||
],
|
||||
);
|
||||
if (entries.length === 0) throw await refuse("user not found");
|
||||
|
||||
const userEntry = entries[0];
|
||||
const userDN = userEntry.dn.toString();
|
||||
// AD supplies its DN as an attribute; avoid re-serializing it through ldapjs.
|
||||
const userDN =
|
||||
firstValue(userEntry, "distinguishedName") || userEntry.dn.toString();
|
||||
const uid =
|
||||
firstValue(userEntry, config.usernameAttribute || "uid") || username;
|
||||
const displayName =
|
||||
|
||||
Reference in new issue
Block a user