mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
66449eedb0
Previously, string "{0}" was replaced by the user dn in the groups_filter attributes of the LDAP configuration. However, if the groups children only have a memberUid attribute, one would like to use the username instead of the user dn. Since the user dn can be built from the username, "{0}" is now replaced by the username instead of the user dn so that an LDAP relying on attribute 'memberUid' can be used.
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import { IClientFactory } from "./IClientFactory";
|
|
import { IClient } from "./IClient";
|
|
import { Client } from "./Client";
|
|
import { ILdapClientFactory } from "./ILdapClientFactory";
|
|
import { LdapConfiguration } from "../configuration/Configuration";
|
|
|
|
import Ldapjs = require("ldapjs");
|
|
import Dovehash = require("dovehash");
|
|
import Winston = require("winston");
|
|
|
|
export class ClientFactory implements IClientFactory {
|
|
private config: LdapConfiguration;
|
|
private ldapClientFactory: ILdapClientFactory;
|
|
private dovehash: typeof Dovehash;
|
|
private logger: typeof Winston;
|
|
|
|
constructor(ldapConfiguration: LdapConfiguration, ldapClientFactory: ILdapClientFactory,
|
|
dovehash: typeof Dovehash, logger: typeof Winston) {
|
|
this.config = ldapConfiguration;
|
|
this.ldapClientFactory = ldapClientFactory;
|
|
this.dovehash = dovehash;
|
|
this.logger = logger;
|
|
}
|
|
|
|
create(userDN: string, password: string): IClient {
|
|
return new Client(userDN, password, this.config, this.ldapClientFactory,
|
|
this.dovehash, this.logger);
|
|
}
|
|
} |