title: verdaccio authenticating against ldap
body: <p>I am experiencing errors when trying to setup verdaccio to authenticate against active directory.I get the following error on the backend which is a centos 7 aws machine and my client machine is in corporate office as well as the AD server (VPN connected):</p>
  
  <p>my steps to recreate:</p>
  
  <pre><code>npm set registry https://npm.mydomain.io
  npm adduser --registry https://npm.mydomain.io
  
  
  
  http  &lt;-- 409, user: undefined, req: 'PUT /-/user/org.couchdb.user:andrewm', error: registration is disabled
  0|verdacci |  http  &lt;-- 200, user: undefined, req: 'GET /-/user/org.couchdb.user:andrewm?write=true', bytes: 0/106
  0|verdacci |  warn  --- LDAP error { message: '80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1\u0000',
  0|verdacci |   name: 'InvalidCredentialsError',
  0|verdacci |   stack: 'InvalidCredentialsError: InvalidCredentialsError\n    at messageCallback (/usr/lib/node_modules/verdaccio-ldap/node_modules/ldapjs/lib/client/client.js:1419:45)\n    at Parser.onMessage (/usr/lib/node_modules/verdaccio-ldap/node_modules/ldapjs/lib/client/client.js:1089:14)\n    at emitOne (events.js:96:13)\n    at Parser.emit (events.js:191:7)\n    at Parser.write (/usr/lib/node_modules/verdaccio-ldap/node_modules/ldapjs/lib/messages/parser.js:111:8)\n    at TLSSocket.onData (/usr/lib/node_modules/verdaccio-ldap/node_modules/ldapjs/lib/client/client.js:1076:22)\n    at emitOne (events.js:96:13)\n    at TLSSocket.emit (events.js:191:7)\n    at readableAddChunk (_stream_readable.js:178:18)\n    at TLSSocket.Readable.push (_stream_readable.js:136:10)',
  0|verdacci |   code: 49,
  0|verdacci |   signal: undefined }
  0|verdacci |  http  &lt;-- 409, user: undefined, req: 'PUT /-/user/org.couchdb.user:andrewm/-rev/undefined', error: registration is disabled
  </code></pre>
  
  <p>and I get the following error on the client machine which is window 7</p>
  
  <pre><code>npm ERR! Windows_NT 6.1.7601
  npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "adduser" "--registry" "https://npm.aud"
  npm ERR! node v6.9.1
  npm ERR! npm  v3.10.8
  npm ERR! code E409
  
  npm ERR! registration is disabled : -/user/org.couchdb.user:andrewm/-rev/undefined
  npm ERR!
  npm ERR! If you need help, you may report this error at:
  npm ERR!     &lt;https://github.com/npm/npm/issues&gt;
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     C:\Users\andrewm\npm-debug.log
  </code></pre>
  
  <p>npm config list</p>
  
  <pre><code>; cli configs
  scope = ""
  user-agent = "npm/4.2.0 node/v7.10.0 linux x64"
  
  ; userconfig /home/ec2-user/.npmrc
  http-proxy = null
  https-proxy = null
  registry = "https://registry.npmjs.org/"
  strict-ssl = false
  
  ; globalconfig /usr/etc/npmrc
  registry = "https://registry.npmjs.org/"
  
  ; node bin location = /usr/bin/node
  ; cwd = /home/ec2-user
  ; HOME = /home/ec2-user
  ; "npm config ls -l" to show all defaults.
  </code></pre>
  
  <p>My config file is below</p>
  
  <pre><code>storage: ./storage
  
  ###########
  auth:
    ldap:
      type: ldap
      groupNameAttribute: 'admin'
      client_options:
        url: "ldaps://tordc1"
        adminDn: "cn=admin,dc=example,dc=com"
        adminPassword: "P@@k3"
        searchBase: "ou=Aud Corp,dc=toronto,dc=aud"
        searchFilter: "(uid={{admin}})"
        cache: False
        searchAttributes:
          - "*"
          - memberOf
        tlsOptions:
          rejectUnauthorized: False
  ##########
  
  
  # a list of other known repositories we can talk to
  uplinks:
    npmjs:
      url: https://registry.npmjs.org/
  ###########
  
  packages:
    # uncomment this for packages with "local-" prefix to be available
    # for admin only, it's a recommended way of handling private packages
     'av-*':
        allow_access: $all
        allow_publish: $all
  
     '*':
        allow_access: $all
        allow_publish: $all
        proxy: npmjs
  
     '@*/*':
        allow_access: $all
        allow_publish: $authenticated
        proxy: npmjs
  
  
  https:
    key: /home/ec2-user/verdaccio/verdaccio-keynew.pem
    cert: /home/ec2-user/verdaccio/verdaccio-certnew.pem
    ca: /home/ec2-user/verdaccio/server.ca
  
  
  # log settings
  logs:
    - {type: stdout, format: pretty, level: http}
    #- {type: file, path: verdaccio.log, level: info}
  
  listen:
  - https://devnpm:4873
  max_body_size: 300mb
  </code></pre>
  
  <p>Could I get some assistance on resolving my issue pleaseÉ</p>
  
  <p>Thank you</p>