nestjs-ldap
TypeScript icon, indicating that this package has built-in type declarations

3.5.1 • Public • Published

NestJS LDAP

Nest Logo

Description

A NestJS library for LDAP (ActiveDirectory)

Installation

$ yarn add nestjs-ldap

Usage

  import { LdapModule, ldapADattributes } from 'nestjs-ldap';

  @Module({
    imports: [
      ...
      LdapModule.registerAsync({
        inject: [ConfigService],
        useFactory: async (configService: ConfigService) => (
          {
            cache: new Redis(), /* optional */
            cacheUrl: 'redis://username:password@example.com:6379/0', /* optional */
            cacheTtl: 600, /* optional */
            domains: [
              'example.com' => {
                url: 'ldaps://pdc.example.local:389',
                bindDN: 'CN=Administrator,DC=example,DC=local',
                bindCredentials: 'PaSsWoRd123',
                searchBase: 'DC=example,DC=local',
                searchFilter: '(&(&(|(&(objectClass=user)(objectCategory=person))(&(objectClass=contact)(objectCategory=person)))))',
                searchScope: 'sub' as Scope,
                groupSearchBase: 'DC=example,DC=local',
                groupSearchFilter: '(&(objectClass=group)(member={{dn}}))',
                groupSearchScope: 'sub' as Scope,
                groupDnProperty: 'dn',
                hideSynchronization: false,
                searchBaseAllUsers: 'DC=example,DC=local',
                searchFilterAllUsers: '(&(&(|(&(objectClass=user)(objectCategory=person))(&(objectClass=contact)(objectCategory=person)))))',
                searchFilterAllGroups: 'objectClass=group',
                searchScopeAllUsers: 'sub' as Scope,
                newObject: 'OU=User,DC=example,DC=local',
                reconnect: true,
                groupSearchAttributes: ldapADattributes,
                searchAttributes: ldapADattributes,
                searchAttributesAllUsers: ldapADattributes,
              },
            ]
          }),
      }),
      ...
    ]
  })
  export class AppModule {}

License

NestJS-ldap is MIT licensed.

Readme

Keywords

Package Sidebar

Install

npm i nestjs-ldap

Weekly Downloads

16

Version

3.5.1

License

MIT

Unpacked Size

276 kB

Total Files

59

Last publish

Collaborators

  • wisekaa03