0.0.4 • Published 6 years ago

cnpm.org-ldap v0.0.4

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
6 years ago

cnpm.org-ldap

usage

https://github.com/cnpm/cnpmjs.org/wiki/Use-Your-Own-User-Authorization

const cnpmLdap = require('cnpm.org-ldap').LdapUserService
config.userService = new cnpmLdap('ldap://localhost', {
  base: 'ou=users,dc=example,dc=com',
  loginField: 'uid', // username attributes
})

options

nametypedesc
loginFieldstringwhich attribute in userObject is username
basestringwhere to search user
filterstringcustom filter example (&({{user}})(accountStatus=active))
tlsOptionsobjectnodejs tls options, used by underlay connection
dnstringlogin dn, leave blank to use anonymous
passwordstringlogin password
attributesobjectuser information

In default, this will use 'mail' field as user's email. Please use options.attributes to customize your user attribute.

interface IAttributes {
  email: string
  name?: string
  html_url?: string
  avatar_url?: string
  im_url?: string
  site_admin?: string
  scopes?: string
}
0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago