Browse Source

bind name

isundil 1 month ago
parent
commit
f79686f138

+ 2 - 2
dist/ldapAuthenticationHandler.d.ts

@@ -2,9 +2,9 @@ import { IAuthenticationHandler } from "./index.js";
 export interface LdapAuthenticationConfiguration {
     ldapUrl: string;
     bindDnField: string;
-    bindRoot: string;
+    bindBase: string;
     usernameField: string;
-    totpField: string | null;
+    totpField?: string | null;
 }
 export declare class LdapAuthenticationHandler implements IAuthenticationHandler {
     private configuration;

+ 1 - 1
dist/ldapAuthenticationHandler.d.ts.map

@@ -1 +1 @@
-{"version":3,"file":"ldapAuthenticationHandler.d.ts","sourceRoot":"","sources":["../src/ldapAuthenticationHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAGpD,MAAM,WAAW,+BAA+B;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,GAAC,IAAI,CAAC;CAC1B;AAOD,qBAAa,yBAA0B,YAAW,sBAAsB;IACpE,OAAO,CAAC,aAAa,CAAkC;gBAEpC,aAAa,EAAE,+BAA+B;YAInD,OAAO;IAyCR,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAMpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAMrF"}
+{"version":3,"file":"ldapAuthenticationHandler.d.ts","sourceRoot":"","sources":["../src/ldapAuthenticationHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAGpD,MAAM,WAAW,+BAA+B;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;CAC3B;AAOD,qBAAa,yBAA0B,YAAW,sBAAsB;IACpE,OAAO,CAAC,aAAa,CAAkC;gBAEpC,aAAa,EAAE,+BAA+B;YAInD,OAAO;IAyCR,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAMpF,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;CAMrF"}

+ 1 - 1
dist/ldapAuthenticationHandler.js

@@ -17,7 +17,7 @@ export class LdapAuthenticationHandler {
             },
             strictDN: true,
         });
-        const bindDn = `${this.configuration.bindDnField}=${username},${this.configuration.bindRoot}`;
+        const bindDn = `${this.configuration.bindDnField}=${username},${this.configuration.bindBase}`;
         let totp = null;
         try {
             await client.bind(bindDn, password);

+ 3 - 3
src/ldapAuthenticationHandler.ts

@@ -5,9 +5,9 @@ import { TotpChecker } from "./totpChecker.js";
 export interface LdapAuthenticationConfiguration {
     ldapUrl: string;
     bindDnField: string;
-    bindRoot: string;
+    bindBase: string;
     usernameField: string;
-    totpField: string|null;
+    totpField?: string|null;
 }
 
 interface AccountInformations {
@@ -34,7 +34,7 @@ export class LdapAuthenticationHandler implements IAuthenticationHandler {
             },
             strictDN: true,
         });
-        const bindDn = `${this.configuration.bindDnField}=${username},${this.configuration.bindRoot}`;
+        const bindDn = `${this.configuration.bindDnField}=${username},${this.configuration.bindBase}`;
         let totp: string|null = null;
 
         try {