Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldapjs client failes #3199

Closed
mikeTWC1984 opened this issue Jun 4, 2023 · 0 comments · Fixed by #3208
Closed

ldapjs client failes #3199

mikeTWC1984 opened this issue Jun 4, 2023 · 0 comments · Fixed by #3208
Labels
bug Something isn't working

Comments

@mikeTWC1984
Copy link

mikeTWC1984 commented Jun 4, 2023

What version of Bun is running?

0.6.7

What platform is your computer?

linux

What steps can reproduce the bug?

start local ldap server:

docker run --detach --rm --name openldap \
  -p 1389:1389 \
  --env LDAP_ADMIN_USERNAME=admin \
  --env LDAP_ADMIN_PASSWORD=adminpassword \
  --env LDAP_USERS=customuser \
  --env LDAP_PASSWORDS=custompassword \
  bitnami/openldap:latest

install ldap client

npm i ldap-authentication

test script:

const { authenticate } = require('ldap-authentication')

async function auth(user, password) {
  // auth with admin
  let options = {
    ldapOpts: {
      url: 'ldap://localhost:1389',
      // tlsOptions: { rejectUnauthorized: false }
    },
    adminDn: 'cn=admin,dc=example,dc=org',
    adminPassword: 'adminpassword',
    userPassword: password,
    userSearchBase: 'dc=example,dc=org',
    usernameAttribute: 'cn',
    username: user,
    attributes: ['dn', 'sn', 'cn', 'uid']
    // starttls: false
  }
  let userInfo = await authenticate(options)
  console.log(userInfo)
}

auth('customuser', 'custompassword')

What is the expected behavior?

Expected result (what nodejs returns):

{
  dn: 'cn=customuser,ou=users,dc=example,dc=org',
  cn: [ 'User1', 'customuser' ],
  sn: 'Bar1',
  uid: 'customuser'
}

What do you see instead?

image

Additional information

@mikeTWC1984 mikeTWC1984 added the bug Something isn't working label Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant